hideSystemUI

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/nadiee/article/details/52136592
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void hideSystemUI() {
   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
      View rootView  = this.getWindow().getDecorView();
      if (rootView != null){
         rootView.setSystemUiVisibility(
                  View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                  | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                  | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                  | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                  | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                  | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
      }
   }
}

猜你喜欢

转载自blog.csdn.net/nadiee/article/details/52136592