Android fragments fitsSystemWindows效果对于具有坐标布局的两个片段之一消失
我有一个带有透明状态栏的活动(包含4个片段)。四个片段中有两个具有AppBarLayout以折叠工具栏。为了避免在透明状态栏后面绘制AppBarLayout,我有:Android fragments fitsSystemWindows效果对于具有坐标布局的两个片段之一消失,android-fragments,statusbar,transparent,android-coordinatorlayout,android-appbarlayout,Android Fragments,Statusbar,Transparent,Android Coordinatorlayout,Android Appbarlayout,我有一个带有透明状态栏的活动(包含4个片段)。四个片段中有两个具有AppBarLayout以折叠工具栏。为了避免在透明状态栏后面绘制AppBarLayout,我有: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-au
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/first_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:statusBarBackground="@color/blue"
>
及
在这两个片段中。我为这两个片段添加了android:fitsystemwindows=“true”
但是,这两个片段中只有一个能够正常工作。一个在状态栏下方绘制,而另一个仍在状态栏后面绘制。你们知道为什么只有一个有效吗
谢谢
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/second_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:statusBarBackground="@color/yellow"
>