3
我得到這個例外,當我試圖從右側 異常打開抽屜式導航重力發現抽屜的看法: 在Android的 - 沒有權利
沒有重力發現抽屜查看RIGHT: java.lang.IllegalArgumentException異常mDrawerLayout.openDrawer(Gravity.RIGHT);
我的佈局文件:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_gravity="right"
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" />
<!-- Listview to display slider menu -->
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:choiceMode="singleChoice"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector"
android:background="@color/list_background"/>
</android.support.v4.widget.DrawerLayout>
有什麼我做錯了嗎? 感謝您的協助。
如果你想從左邊打開,只需使用代碼: android:layout_gravity =「start」 – ymerdrengene 2015-02-03 14:37:30