问题描述
我如何从操作栏的右上角删除设置图标?当我模仿我的实际三星galaxy S3手机,它不存在,但是,当我在模拟一个AVD的的Nexus 7,它出现。这里是code我的菜单:
<菜单的xmlns:机器人=http://schemas.android.com/apk/res/android&GT ; <项目 机器人:ID =@ + ID / action_settings 机器人:orderInCategory =100 机器人:showAsAction =从不 机器人:标题=@字符串/ action_settings/> <项目 机器人:ID =@ + ID / main_menu_actionbutton 机器人:orderInCategory =100 机器人:showAsAction =总是 机器人:标题=@字符串/菜单/>< /菜单>
如果你指的是三个点,这就是所谓的溢出菜单。它存在于不具备硬件菜单按钮的设备 - 这你的银河S3了,而Nexus 7保护没有。所以,在你的S3您preSS菜单按钮,并得到弹出底部,但对你的Nexus preSS三个点并获得溢出弹出式操作栏中的在下降。如果它不存在,你怎么就能够访问溢出的项目?
如果你只是想干脆删除它,只是删除第一个<项目/>
在进入menu.xml文件
您发布。
How do I remove the settings icon from the top-right of the action bar? When I emulate on my actual Samsung galaxy s3 phone, it is not there, however, when I emulate on an AVD for the Nexus 7, it appears. Here is the code for my menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
<item
android:id="@+id/main_menu_actionbutton"
android:orderInCategory="100"
android:showAsAction="always"
android:title="@string/Menu"/>
</menu>
If you mean the three dots, that's called the overflow menu. It exists on devices which do not have a hardware menu button - which your Galaxy S3 has, while the Nexus 7 does not. So on your S3 you press the menu button and get the popup at the bottom, but on the Nexus you press the 3 dots and get the overflow popup dropping down from the action bar. If it wasn't there, how would you be able to access overflow items?
If you'd simply like to remove it altogether, just delete the first <item />
entry in the menu.xml
you posted.
这篇关于如何删除在操作栏右上角的设置图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!