Android 3.0系统栏菜单
我想在 Android 3.0 的系统栏中添加一个菜单按钮,附件是 Android 3.0 上的 Firefox 应用程序的图片,它提供了系统栏菜单按钮,单击该按钮您会看到 4 个选项(站点选项、首选项、添加-on,下载)。我想知道如何在系统栏中添加这个按钮(标记为红色)及其相应的选项。
PS:我已经尝试添加方法 nCreateOptionsMenu(Menu menu)
和 onOptionsItemSelected(MenuItem item)
,但是这些方法在操作栏中给了我菜单按钮,我不想要这个按钮,
谢谢。
I would like to add a menu button in the System bar of Android 3.0, attached is a picture of the Firefox app on Android 3.0 which gives the system bar menu button and on clicking the button you see 4 options(Site Options, Preferences, Add-ons, Downloads). I would like to know how do I add this button(marked in red) in the system bar and also its corresponding options.
P.S: I have already tried adding the methods nCreateOptionsMenu(Menu menu)
and onOptionsItemSelected(MenuItem item)
, but these methods give me menu button in the action bar, which I dont' want.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的应用程序声明的 targetSdkVersion 和 minSdkVersion 小于 11,您只会获得菜单按钮,这也意味着您不再编写“蜂窝应用程序”。这是一个兼容性功能。
蜂窝平板电脑应用程序应在操作栏或屏幕上的其他位置显示其菜单。
You only get the menu button if your app's declared targetSdkVersion and minSdkVersion are less than 11, which also means you're no longer writing a "honeycomb app." It's a compatibility feature.
Honeycomb tablet apps should display their menus in the action bar or elsewhere on-screen.
这是因为 Firefox 没有针对 Honeycomb 进行更新。一旦完成,他们的选项菜单将出现在操作栏中。随着时间的推移,所有应用程序的选项菜单都将位于操作栏中。系统栏中的选项菜单仅适用于 Honeycomb 之前的应用程序。
That is because Firefox is not updated for Honeycomb. Once it is, their options menu will be in the action bar. Over time, all applications' options menus will be in the action bar. Options menus in the system bar are only for pre-Honeycomb apps.