android 右边弹出菜单,android – 在菜单项右侧显示抽屉菜单图标

作者分享了如何将Android应用中的导航抽屉菜单图标从左侧移到右侧,包括`menu.xml`文件的修改和布局调整,寻求解决具体UI设计问题的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我有一个从右到左打开的导航抽屉,一切正常,汉堡图标工作正常,它位于右上角,但菜单图标位于菜单项的左侧.

如何将它们移动到菜单项的右侧?

请看屏幕截图

fffc279ba927b268b20291c0e91d3d5d.png

这是我的menu.xml

android:id="@+id/nav_home"

android:icon="@drawable/ic_navigation_home"

android:title="@string/nav_menu_home" />

android:id="@+id/nav_profile"

android:icon="@drawable/ic_menu_profile"

android:title="@string/nav_profile" />

android:id="@+id/nav_help"

android:icon="@drawable/ic_navigation_help"

android:title="@string/nav_help" />

android:id="@+id/nav_manage"

android:icon="@drawable/ic_menu_manage"

android:title="@string/nav_manage" />

android:id="@+id/nav_logout"

android:icon="@drawable/ic_logout"

android:title="@string/nav_logout" />

android:id="@+id/nav_facebook"

android:icon="@drawable/ic_facebookx"

android:title="@string/nav_face_page" />

android:id="@+id/nav_send"

android:icon="@drawable/ic_menu_send"

android:title="@string/nav_contact" />

这是我的布局

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:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical">

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:theme="@style/AppTheme.AppBarOverlay">

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:background="?attr/colorPrimary"

app:popupTheme="@style/AppTheme.PopupOverlay" />

android:id="@+id/drawer_layout"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:fitsSystemWindows="true"

tools:openDrawer="start">

layout="@layout/app_bar_main"

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

android:fitsSystemWindows="true"

app:headerLayout="@layout/nav_header_main"

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

我搜索了很多,但没有找到任何与此问题相关的内容.

提前致谢.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值