【发布时间】:2015-11-06 21:37:36
【问题描述】:
我正在使用 android 设计支持库,我想知道如何才能拥有从右到左的导航抽屉,我将重力设置为右,但只有导航抽屉本身向右移动,我想知道如何我把菜单项放在右边? 导航视图:
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:foregroundGravity="right"
app:headerLayout="@layout/header"
app:menu="@menu/drawer" />
抽屉布局:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity"
android:layout_gravity="right">
菜单:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/one"
android:checked="false"
android:icon="@drawable/account"
android:title="First Item"></item>
<item
android:id="@+id/two"
android:checked="false"
android:icon="@drawable/filter"
android:title="Second Item"></item>
<item
android:id="@+id/three"
android:checked="false"
android:icon="@drawable/human"
android:title="Third Item"></item>
</group>
提前致谢
【问题讨论】:
标签: android navigation right-to-left