Android 导航抽屉未启动
我有导航抽屉,需要打开,但无法>> 这是我的drawer_layout.xml:Android 导航抽屉未启动,android,navigation-drawer,Android,Navigation Drawer,我有导航抽屉,需要打开,但无法>> 这是我的drawer_layout.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="m
<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">
<!-- This LinearLayout represents the contents of the screen -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- The ActionBar displayed at the top -->
<include
layout="@layout/activity_display"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- The main content view where fragments are loaded -->
<FrameLayout
android:id="@+id/flContent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- The navigation drawer that comes from the left -->
<!-- Note that `android:layout_gravity` needs to be set to 'start' -->
<android.support.design.widget.NavigationView
android:id="@+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="@android:color/white"
app:menu="@menu/drawer_view" />
我不知道为什么我不能开始我的导航绘图。。
我在屏幕上看不到它。在xml文件中写入结束而不是右键
android:layout_gravity="right"
到
或替代解决方案
使用
而不是
mDrawer.openDrawer(GravityCompat.END);
在我改变它之前是这样的,但它不起作用
android:layout_gravity="right"
android:layout_gravity="end"
mDrawer.openDrawer(GravityCompat.RIGHT);
mDrawer.openDrawer(GravityCompat.END);