隐藏导航栏android

Hiding navigation bar android

如何在 android 中隐藏导航栏以及从哪个 android 版本隐藏导航栏?

我想让应用全屏显示。应用程序 运行 时不会显示导航栏。

请给我一个详细信息..谢谢..

试试这个代码:

   getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);

您可以使用 SYSTEM_UI_FLAG_HIDE_NAVIGATION 标志在 Android 4.0 及更高版本上隐藏导航栏。此代码段隐藏了导航栏和状态栏:

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);

你也可以看看这个link: http://developer.android.com/training/system-ui/navigation.html#40