0
当在frameLayout上使用android:fitsSystemWindows="true"
两次第二个 android:fitsSystemWindows="true"
被忽略,我得到的结果显示在图像中。我期待第二个框架布局适合第一个不在导航栏或状态栏下面。为什么? 布局,我用: 第二个属性android:fitsSystemWindows =“true”被忽略
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorAccent" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fitsSystemWindows="true">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fitsSystemWindows="true">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark" />
</FrameLayout>
</LinearLayout>
和活动风格
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>