android far菜单,android - Android从右到左的NavigationDrawer菜单项不是RTL - 堆栈内存溢出...

我需要将导航菜单项对齐到右侧。 我阅读了很多文章,问题和答案,但我找不到我的项目中的错误。 这是我的xml:

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="right">

layout="@layout/content_activity_home"

android:layout_width="match_parent"

android:layout_height="match_parent" />

android:id="@+id/nav_view"

android:layout_width="wrap_content"

android:layout_height="match_parent"

android:layout_gravity="right"

android:fitsSystemWindows="true"

app:headerLayout="@layout/nav_header_activity_home"

app:menu="@menu/activity_home_drawer" />

这是activity_home_drawer.xml :

android:id="@+id/menu_account"

android:icon="@drawable/ic_profile"

android:title="حساب کاربری" />

android:id="@+id/menu_logout"

android:icon="@drawable/ic_sign_out"

android:title="خروج از حساب" />

我可以让抽屉本身从右边打开,但NavigationView的元素仍然是从左到右。 你可以在这里看到结果:

6d8fc7e5728530be649eec6cc90b9ecf.png

如您所见,菜单项不是从右到左。 如何让他们rtl?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值