相关疑难解决方法(0)

禁用在android中打开导航抽屉的滑动手势

我一直在关注谷歌的导航抽屉指南,我想将它添加到带有标签和手势的活动中.

我想禁用打开导航抽屉的手势,有没有人知道如何做到这一点?

navigation tabs android gesture drawer

175
推荐指数
6
解决办法
7万
查看次数

为什么我无法用布局重力锁定DrawerLayout

我使用DrawerLayout,最近我想在drawerLayout中改变listView的重力.但是在我将listView的重力改为android:layout_gravity="start|bottom"from后android:layout_gravity="start",drawerLayout无法锁定

mDrawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
Run Code Online (Sandbox Code Playgroud)

setDrawerLockMode()使用;

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

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</RelativeLayout>

<ListView
    android:id="@+id/drawer_list"
    android:layout_width="320dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="#F3F3F4"
    android:choiceMode="singleChoice" >
</ListView>
Run Code Online (Sandbox Code Playgroud)

但它没有锁定;

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

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</RelativeLayout>

<ListView
    android:id="@+id/drawer_list"
    android:layout_width="320dp"
    android:layout_height="match_parent"
    android:layout_gravity="start|bottom"
    android:background="#F3F3F4"
    android:choiceMode="singleChoice" >
</ListView>
Run Code Online (Sandbox Code Playgroud)

`

任何线索为什么我不能使用其他重力的锁模式?

谢谢!

android listview gravity drawerlayout

8
推荐指数
1
解决办法
9314
查看次数

标签 统计

android ×2

drawer ×1

drawerlayout ×1

gesture ×1

gravity ×1

listview ×1

navigation ×1

tabs ×1