Android隐藏状态栏、导航栏

Android隐藏状态栏、导航栏

  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. }
上一篇:Kafka术语解释


下一篇:Android 5.0状态栏和导航栏