【问题标题】:hide the navigation bar "more" button at the bottom of the screen on Android在Android上隐藏屏幕底部的导航栏“更多”按钮
【发布时间】:2013-05-15 13:08:41
【问题描述】:

在我的应用程序中,在某些设备(例如 HTC One)上,我有一个仅包含“更多”按钮(例如:三个垂直点)的栏。下面的示例使用获得相同行为的 Amazon 应用程序。

我试图通过在我的清单中添加它来删除它:

<application
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" > </application>

没有用。我还尝试更改显示视图的可见性:

View v = this.findViewById(android.R.id.content);
v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

但它仅在显示活动时才有效。当我在视图上进行交互时,导航栏会重新出现。

我注意到这个导航栏既没有出现在 Galaxy S III 上,也没有出现在 Galaxy S II 上。这个导航栏只能因为HTC One屏幕分辨率大才显示吗?

有没有什么办法可以只在它出现时才移除它?

【问题讨论】:

    标签: android view android-activity


    【解决方案1】:

    将您的 android:targetSdkVersion 设置为 14 或更高。有关更多详细信息,请参阅大约一年前的 this blog post of mine

    【讨论】:

    • 感谢您的提示,但设置为 minSdkVersion=14 不会删除菜单按钮...我错过了什么吗?
    • 我的错,我将 android:minSdkVersion 设置为 14 而不是 android:targetSdkVersion
    • 有效,但我需要使用android:targetSdkVersion=10。有什么想法吗?
    • @annelorayne:我的建议是让您提出一个单独的 Stack Overflow 问题,在其中解释您认为需要 android:targetSdkVersion=10 的原因,以便您在解决该问题时获得帮助。目前没有人应该使用android:targetSdkVersion=10
    • 谢谢,@CommonsWare。
    猜你喜欢
    • 2020-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 1970-01-01
    • 2020-12-12
    相关资源
    最近更新 更多