Hiding the Navigation Bar

去除虚拟导航

developer.android.com: Hiding the Navigation Bar

1
2
3
4
5
6
7
8
9
10
11
private void hideSystemNavigationBar() {
if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) {
View view = this.getWindow().getDecorView();
view.setSystemUiVisibility(View.GONE);
} else if (Build.VERSION.SDK_INT >= 19) {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}
-------------------本文结束 感谢您的阅读-------------------