如何隐藏android中的导航栏以及Android版本的导航栏?
我想让应用程序全屏显示。应用程序运行时,不会显示导航栏。
请给我一个关于此的详细信息。谢谢......
答案 0 :(得分:1)
试用此代码:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
答案 1 :(得分:0)
您可以使用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);
您还可以查看此链接: http://developer.android.com/training/system-ui/navigation.html#40