【问题标题】:Hiding / disabling navigation bar on android 4.4.4在 android 4.4.4 上隐藏/禁用导航栏
【发布时间】:2016-08-28 12:22:20
【问题描述】:

我正在为运行 android 4.4.4 的特定平板电脑开发应用程序。不允许用户关闭应用程序。我希望有一种方法可以完全隐藏或禁用导航栏,但我似乎找不到解决方案。我已经尝试使用Using Immersive fullscreen 上解释的方法,但似乎没有任何效果。有什么建议吗?

【问题讨论】:

标签: java android navigation hide navigationbar


【解决方案1】:

您可以使用 SYSTEM_UI_FLAG_HIDE_NAVIGATION 标志隐藏导航栏。

试试这个代码

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-23
    • 2015-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    • 1970-01-01
    相关资源
    最近更新 更多