我真的很讨厌Android主题化过程。我在每个位置添加android:fitsSystemWindows
,然后删除,然后再次。
我应该在哪里放置它,以便页面内容像Navigation View
一样放在Navigation Drawer
后面?
我的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
android:fitsSystemWindows="true">
<LinearLayout>
<android.support.design.widget.AppBarLayout
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar/>
<com.github.sundeepk.compactcalendarview.CompactCalendarView />
</android.support.design.widget.AppBarLayout>
<FrameLayout <<--Content here-->> />
</LinearLayout>
<android.support.design.widget.NavigationView
android:fitsSystemWindows="true"/>
</android.support.v4.widget.DrawerLayout>
我的主题:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item>
<item name="android:windowTranslucentNavigation" tools:targetApi="kitkat">true</item>
<item name="android:textColor">@color/primary_text</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>