第一種:始終隱藏,觸摸屏幕時也不出現——
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);