Android隐藏状态栏、导航栏

Android隐藏状态栏、导航栏

 

[java] view plain copy
 
在CODE上查看代码片派生到我的代码片
  1. private void hideStatusNavigationBar(){  
  2.     if(Build.VERSION.SDK_INT<16){  
  3.         this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  
  4.                 WindowManager.LayoutParams.FLAG_FULLSCREEN);  
  5.     }else{  
  6.         int uiFlags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN  
  7.                 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION  
  8.                 | View.SYSTEM_UI_FLAG_FULLSCREEN //hide statusBar  
  9.                 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; //hide navigationBar  
  10.         getWindow().getDecorView().setSystemUiVisibility(uiFlags);  
  11.     }  
  12. }  
posted @ 2016-08-17 17:50  scgw  阅读(7810)  评论(0编辑  收藏  举报