android蜂窝菜单按钮目标 [英] android honeycomb menu button target

查看:31
本文介绍了android蜂窝菜单按钮目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的应用向后兼容,所以我需要显示菜单按钮因为我们在以前的版本中使用了应用程序中的菜单按钮.

I am trying to get my app to be backward compatible so i need to show the menu button since we used the menu button in our app on previous versions.

所以我正在阅读,它说如果您的目标是 11 (3.0),那么您将无法获得菜单按钮,但您的目标是 10,他们会这样做.

So I was reading and it says that if your target is 11 (3.0) than you don't get the menu button but it your target is 10 they you do.

但问题是我使用的是片段,所以我的目标必须是 11.

But the issue is I am using fragments so my target has to be 11.

任何想法.

推荐答案

无论 Android 版本如何,都会出现普通选项菜单.如果您有:

Ordinary options menus will appear regardless of Android version. If you have:

android:targetSdkVersion="11"

然后选项菜单将出现在 Android 3.0+ 设备的操作栏中.单击右上角的溢出"按钮时,选项菜单中的所有项目都可用.您的选项菜单将正常显示在 Android 1.x 和 2.x 设备上,即使您的 中有 android:targetSdkVersion="11"清单元素.

then the options menu will appear in the action bar on Android 3.0+ devices. All items in the options menu will be available when clicking the "overflow" button in the upper-right corner. Your options menu will appear normally on Android 1.x and 2.x devices, even if you have android:targetSdkVersion="11" in your <uses-sdk> manifest element.

如果您覆盖 MENU 按钮以获得其他行为,您将需要为 API 级别 11 及更高级别的该行为创建一些其他触发器.覆盖 MENU 按钮从一开始就不是一个好主意,正如您所看到的,现在它更不是一个好主意.如果您有 android:targetSdkVersion="11",我知道无法在 Android 3.0 设备上获得 MENU 按钮.

If you overrode the MENU button to have other behavior, you will need to create some other trigger for that behavior for API Level 11 and higher. Overriding the MENU button was never a good idea to begin with, and as you can see, it is even less of a good idea now. I know of no way to get a MENU button on an Android 3.0 device if you have android:targetSdkVersion="11".

这篇关于android蜂窝菜单按钮目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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