【发布时间】:2017-11-02 09:19:08
【问题描述】:
我的项目截图:My Project
我的目标设计:My Target
我创建了一个(从右到左)导航抽屉。它工作正常,但是当我试图将图标从左侧移动到右侧时,它不起作用。
<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="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@color/nav"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:itemIconTint="#d2a967"
app:itemTextColor="#d2a967"
app:menu="@menu/activity_main_drawer" />
注意:我的 API 是 14+
【问题讨论】:
-
看this可以帮忙,创建一个像他一样的自定义工具栏。
-
快速修复
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);。
标签: android navigation-drawer drawerlayout