抽屉布局片段

问题描述 投票:0回答:1

我想在一个片段来实现抽屉布局,但是,如果我用。“机器人: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>

Image (if I swipe to the right

android-studio android-fragments drawerlayout
1个回答
0
投票

通过查看this gist,你应该添加android:fitsSystemWindows="true"DrawerLayout并设置其宽度match_parent。我的猜测是,它应该是孩子NavigationView它可以有一个定义的宽度。

© www.soinside.com 2019 - 2024. All rights reserved.