简体   繁体   English

操作栏溢出菜单项不会出现

[英]Action bar overflow menu items doesn't appear

I've just finished a test app that I wanted to be supported in all android devices from 2.1, so I used the support library to the support the action bar but I'm getting a problem in a device with android 2.3 ... Everything seems to be fine, the action bar and all the itens I choosed to be show "ifRoom" are appearing but the overflow drop down itens menu is missing, I don't really know why. 我刚刚完成了一个测试应用程序,我希望在2.1的所有Android设备中得到支持,所以我使用支持库来支持操作栏,但我在设备上遇到了问题,但是我在Android 2.3 ...似乎很好,操作栏和我选择显示“ifRoom”的所有itens正在出现但溢出下降itens菜单丢失,我真的不知道为什么。 Does android devices below 3.0 support this overflow menu or what? 3.0以下的Android设备是否支持此溢出菜单或什么?

There's my xml code in the second activity: 第二个活动中有我的xml代码:

<menu xmlns:android="http://schemas.android.com/apk/res/android" 
  xmlns:teste="http://schemas.android.com/apk/res-auto" >

<item android:id="@+id/action_search"
    android:showAsAction="ifRoom"
    teste:showAsAction="ifRoom"
    android:icon="@drawable/ic_action_search"
    android:title="@string/action_search" />

<item android:id="@+id/action_edit"
    android:showAsAction="ifRoom"
    teste:showAsAction="ifRoom"
    android:icon="@drawable/ic_action_edit"
    android:title="@string/action_edit" />

<item
    android:id="@+id/action_settings"
    android:showAsAction="never"
    teste:showAsAction="never"
    android:title="@string/action_settings" />

Anyone can help me pls? 有人可以帮我吗? ps: sorry the bad English ps:对不起英语不好

Overflow menu is hidden in ActionBar if your device has hardware 'Menu' button. 如果您的设备具有硬件“菜单”按钮,则会在ActionBar中隐藏溢出菜单。 Press it and check - your items should be there :) 按它并检查 - 你的物品应该在那里:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM