私はDrawerLayoutを使用しています。最近、私はdrawerLayoutのlistViewの重力を変更したいと思います。私はandroid:layout_gravity="start"
からandroid:layout_gravity="start|bottom"
にListViewコントロールの重力を変更した後しかし、drawerLayoutはレイアウトの重力でDrawerLayoutをロックできない理由
mDrawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
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>
しかし、それはしてロックしません。
<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>
`
私は他の重力でロックモードを使用できない理由の任意の手がかり?
ありがとうございます!
ありがとうございました。私はすでにリストビューを別のレイアウトに追加してこの問題を修正しました。しかし、このコードは私の質問を説明します。 –
あなたは大歓迎です!あなたが達成したいと思っていたものに代わるものを見つけることを祝福しました: –
正解ですが、「END」と「START」もサポートする必要があります –