我遇到了问题,我的操作栏中的“设置”按钮未显示。我制作的菜单按钮显示正常,但它的右侧没有任何内容(3个点应该是这个位置)。有人知道如果我做了错误的东西,它不显示?我可以在menu.xmp中看到它,但是当我运行它时,它不在那里。不显示操作栏设置
这是我menu.xml文件(my.xml):
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MyActivity" >
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="2"
android:showAsAction="never" />
<item android:id="@+id/action_menu"
android:title="Menu"
android:orderInCategory="1"
android:showAsAction="ifRoom" />
</menu>
充气菜单这里:
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.my, menu);
return true;
}
你可以发布你膨胀菜单的代码吗? – 2014-10-29 02:35:00
您的测试设备是否有硬件菜单按钮? – 2014-10-29 02:38:46
是的,它的Galaxy S4。如果是这样,你的意思是左下角打开设置菜单的按钮。 – Shawn 2014-10-29 02:40:16