我如何隐藏一个活动菜单按钮 [英] How I hide the menu button for one activity
问题描述
有具有没有菜单项的活性。所以我想隐藏菜单按钮。有没有什么办法来实现这一目标? 谢谢
There is an activity which has no menu item. So I want to hide the menu button. Is there any way to achieve that? Thanks
推荐答案
我知道如何可以做到这一点。在你的AndroidManifest.xml中,需要指定类似如下:
I figured out how this can be done. In your AndroidManifest.xml, you need to specify something like the following:
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="14" />
基本上,的minSdkVersion
是最小的Android SDK版本,您的应用程序支持(在我的情况下,2.2)和 targetSdkVersion
为你打靶的版本(即你的preferred的版本 - 在我的情况,这是4.0)
Basically, minSdkVersion
is the minimum Android SDK version that you application supports (in my case, 2.2) and targetSdkVersion
is the version you're "targetting" (i.e. your "preferred" version - in my case, that's 4.0)
在默认情况下, targetSdkVersion
是一样的的minSdkVersion
,如果你离开了pre-蜂窝,你基本上是告诉机器人,你的应用程序是遗产,它会始终显示菜单按钮。
By default, targetSdkVersion
is the same as minSdkVersion
, and if you leave that pre-Honeycomb, you're basically telling Android that your app is "legacy" and it'll always show the menu button.
如果你让 targetSdkVersion
后蜂窝,然后选择菜单按钮才会显示,如果你确实有菜单项中定义。
If you make targetSdkVersion
post-Honeycomb, then the menu button will only be shown if you actually have menu items defined.
这篇关于我如何隐藏一个活动菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!