Das AppBarLayout wird hinter der Statusleiste angezeigt. Ich habe die Navigationsleiste durchscheinend gemacht. Wenn ich fitSystemWindow verwende, wird der Inhalt nicht unterhalb der Navigationsleiste angezeigt. Ich möchte unterhalb Navigationsleiste halten und die AppBarLayout unter Statusleiste machenWie verhindert man, dass AppBarLayout hinter die Statusleiste geht?
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragment_main_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/fragment_main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="@string/app_name"
app:layout_scrollFlags="scroll|enterAlways"
app:titleTextColor="@android:color/white"/>
<android.support.design.widget.TabLayout
android:id="@+id/fragment_main_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:tabBackground="@android:color/white"
app:tabGravity="fill"
app:tabIndicatorColor="@color/colorPrimary"
app:tabMaxWidth="0dp"
app:tabSelectedTextColor="@color/colorPrimary"
app:tabTextColor="@color/tab_unselected">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/fragment_main_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/colorPrimary">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="bottom|right"
android:src="@drawable/navbar_bottom"/>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
können Sie Symbolleiste aus AppbarLayout verwenden. – KrishnaJ
Aber ich brauche auch den Scrolling-Effekt, d. H. Die Scroll-Flags –
können Sie in lineares Layout setzen und auch in scrollview, wenn Ihre Anforderungen so sind. – KrishnaJ