【发布时间】:2015-10-10 08:48:54
【问题描述】:
我一直在处理这个 DrawerLayout 和 NavigationViews,但我似乎无法解决这个问题。根据谷歌指南,第一个导航栏应该覆盖应用栏,第二个不应该。
我如何做到这一点?无论我做什么,要么让它们都覆盖,要么它们都没有覆盖应用栏。
由于导航视图相当新,我无法通过谷歌搜索和探索overflow.com 获得任何合适的答案。非常感谢任何指南、帮助、教程、示例...。
之前谢谢。
这是我的activity.xml
<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/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<LinearLayout
android:orientation="vertical"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<include
android:id="@+id/app_bar"
layout="@layout/app_bar">
</include>
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_draw"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer"/>
<android.support.design.widget.NavigationView
android:id="@+id/second_nav_draw"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
/>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
标签: android navigation-drawer material-design android-design-library android-navigationview