我想在一个片段来实现抽屉布局,但是,如果我用。“机器人:layout_gravity =”开始”,然后我的导航只是disappears.The相同的代码工作正常,如果我把它放在一个活动,如果我尝试对刷卡正确的,它也不起作用(你可以看到它,我张贴的图像)。对我来说,它看起来像我不能刷卡的权利和为此导航视图无法打开?
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="200dp"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.design.widget.NavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/bottom_navigation">
/>
</android.support.v4.widget.DrawerLayout>
通过查看this gist,你应该添加android:fitsSystemWindows="true"
到DrawerLayout
并设置其宽度match_parent
。我的猜测是,它应该是孩子NavigationView
它可以有一个定义的宽度。