导航视图后面的导航抽屉,但主要内容不是

时间:2018-08-13 21:01:09

标签: android view android-theme

我真的很讨厌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>

enter image description here enter image description here

0 个答案:

没有答案