簡體   English   中英

在雙重導航抽屜布局中禁用導航抽屜

[英]Disabling a navigation drawer in double navigation drawer layout

我有一個雙導航抽屜,一個從左到右。 我只想顯示一些片段的正確導航抽屜。 所以我想從其他人禁用它。 這是我的布局

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Framelayout to display Fragments -->
<FrameLayout
    android:id="@+id/frame_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</FrameLayout>

<!-- Listview to display slider menu -->
<ListView
    android:id="@+id/list_slidermenu"
    android:layout_width="120dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:choiceMode="singleChoice"
    android:divider="@color/orange"
    android:dividerHeight="1dp"       
    android:listSelector="@drawable/list_selector"
    android:background="@color/orange"/>

<!-- Listview for messages -->
  <ListView
    android:id="@+id/message_slidermenu"
    android:layout_width="200dp"
    android:layout_height="match_parent"
    android:layout_gravity="end"
    android:background="#1C1C1C"
    android:choiceMode="singleChoice"
    android:divider="#1C1C1C"
    android:dividerHeight="1dp"
    android:listSelector="@drawable/list_selector"
     />

我見過

mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

將鎖定抽屜。 但是我該如何只鎖定一個導航抽屜

重載setDrawerLockMode (int lockMode, int edgeGravity)方法setDrawerLockMode (int lockMode, int edgeGravity)允許您指定要鎖定其重力的抽屜。 重載setDrawerLockMode (int lockMode, View drawerView)抽屜視圖setDrawerLockMode (int lockMode, View drawerView)使您可以通過指定抽屜視圖來執行相同的操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM