Android - no RIGHT gravity drawer review

I am getting this exception when I try to open the navigation drawer on the right Exception: java.lang.IllegalArgumentException: Gravity view drawer is not possible when

mDrawerLayout.openDrawer(Gravity.RIGHT);

      

My layout file:

<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>

      

Am I doing something wrong? Thank you for your help.

+3


source to share


1 answer


Anyway, I started working on my own, for others who find it difficult to decide. Here's what I did, I changed the android:layout_gravity="right"

list view to android:layout_gravity="end"

and it started working fine.



+6


source







All Articles