Android隐藏状态栏、导航栏
[java] view plain copy
- private void hideStatusNavigationBar(){
- if(Build.VERSION.SDK_INT<16){
- this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }else{
- int uiFlags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_FULLSCREEN //hide statusBar
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; //hide navigationBar
- getWindow().getDecorView().setSystemUiVisibility(uiFlags);
- }
- }
时间: 2024-12-28 02:44:42