android - Moving navigation drawer items to right -
i need please me. have navigation drawer in app. want move navigation drawer right . moved navigation want move menu items right too.
my screenshot of navigation drawer
activity_main:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_marginleft="100dip" android:fitssystemwindows="true" tools:opendrawer="end"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="end" android:fitssystemwindows="true" app:headerlayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer" /> </android.support.v4.widget.drawerlayout>
my items of menu in xml :
activity_main_drawer:
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkablebehavior="single"> <item android:id="@+id/nav_home" android:icon="@drawable/ic_home_black_24dp" android:title="@string/nav_home" /> <item android:id="@+id/nav_photos" android:icon="@drawable/ic_photo_library_black_24dp" android:title="@string/nav_photos" /> <item android:id="@+id/nav_movies" android:icon="@drawable/ic_local_movies_black_24dp" android:title="@string/nav_movies" /> <item android:id="@+id/nav_notifications" android:icon="@drawable/ic_notifications_black_24dp" android:title="@string/nav_notifications" /> <item android:id="@+id/nav_settings" android:icon="@drawable/ic_settings_black_24dp" android:title="@string/nav_settings" /> </group> <item android:title="other"> <menu> <item android:id="@+id/nav_about_us" android:title="@string/nav_about_us" /> <item android:id="@+id/nav_privacy_policy" android:title="@string/privacy_policy" /> </menu> </item> </menu>
you need use custom layout navigationview.
according this: http://www.kamilslesinski.com/home/navigation-drawer-customising-navigationview-items can override layout copying original file , customizing it, or can add reference custom layout, that: how customize snackbar's layout? in refs.xml.
Comments
Post a Comment