显示选项对Galaxy Nexus的(安卓4.1)菜单按钮 [英] Show options menu button on Galaxy Nexus (Android 4.1)

查看:222
本文介绍了显示选项对Galaxy Nexus的(安卓4.1)菜单按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的选项菜单中的我的应用程序。但是,当我安装一个Galaxy Nexus的应用程序,我没有看到选项菜单,因为默认情况下它并没有选项菜单按钮。我怎样才能显示我的应用程序选项菜单按钮,仅Galaxy Nexus的?与其他手机它的罚款,我可以得到的选项菜单。

I am using options menu in my app. But when I install the app on a Galaxy Nexus, I don't see options menu because by default it doesn't have options menu button. How can I show options menu button in my App for only Galaxy Nexus? With other phones it's fine, and I can get options Menu.

推荐答案

在的Andr​​oid 3.0,谷歌跳槽由具有专门的菜单键,可以使用动作条的菜单功能。如果您的构建目标是3.0或以上,你的菜单将默认使用动作条

In Android 3.0, Google switched from having a dedicated menu key to using the ActionBar for menu functionality. If your build target is 3.0 or above, your menu will default to using the ActionBar.

如果有手机上的菜单键,选择以上任何运行,通常是由操作栏上的三个点的图标显示将改为显示的菜单按钮。如果手机上没有菜单键,所有选项将显示在操作栏。由于菜单键会消失,这是鼓励你使用了动作条类3.0及以后你的菜单。

If there is a menu key on the phone, any run over options that are usually shown by the three dots icon in the action bar will instead show up with the menu button. If there is no menu key on the phone, all options will be shown on the action bar. Because the menu key is going away, it is encouraged that you utilize the ActionBar class for your menus from 3.0 and beyond.

现在,是在新的平台上运行,而不菜单键旧的应用程序会生成一个假的菜单键旁边的近期应用程序按钮。如果您的构建目标是2.3.4或更低,因为它只有在那里向后兼容该临时菜单键才会出现。 (编辑:构建目标应该是任何小于或包括API 13)

Now, older apps that run on new platforms without a menu key will generate a fake menu key next to the recent apps button. This makeshift menu key will only appear if your build target is 2.3.4 or below since it's only there for backwards compatibility reasons. (edit: build target should be anything less than, or including API 13)

在你的情况,你应该利用动作条为你的菜单,因为你正在构建针对Android系统的新版本。如果你担心向后兼容,那么你可以随时使用的库如ActionBarSherlock使用操作栏上的旧平台。

In your case, you should utilize the ActionBar for your menu since you're building against a newer version of Android. If you're worried about backwards compatibility then you can always utilize a library such as ActionBarSherlock to use the action bar on older platforms.

这篇关于显示选项对Galaxy Nexus的(安卓4.1)菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆