【发布时间】:2016-07-29 10:04:58
【问题描述】:
我正在第一次使用带有 Material Design 库的新导航抽屉测试一个应用程序。
我的问题是,当我选择一个项目时,包括图标在内的整个选定项目都被完全覆盖,如下图所示。 我的错误可能是什么?我尝试了几件事,但都没有成功。
这是带有导航抽屉的 XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
/>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
标签: android material-design navigation-drawer