第一种:始终隐藏,触摸屏幕时也不出现——
WindowManager.LayoutParams params = getWindow().getAttributes(); params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE; getWindow().setAttributes(params);
第二种:隐藏了,但触摸屏幕时出现——
WindowManager.LayoutParams params = getWindow().getAttributes(); params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; getWindow().setAttributes(params);