設置系統欄可見性

public static void setSystemBarVisible(final Activity context,
   boolean visible) {
  int flag = context.getWindow().getDecorView().getSystemUiVisibility();
  // int fullScreen = View.SYSTEM_UI_FLAG_SHOW_FULLSCREEN;
  int fullScreen = 0x8;
  if (visible) {
   if ((flag & fullScreen) != 0) {
    context.getWindow().getDecorView()
      .setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
   }
  } else {
   if ((flag & fullScreen) == 0) {
    context.getWindow().getDecorView()
      .setSystemUiVisibility(flag | fullScreen);
   }
  }
 }
發佈了140 篇原創文章 · 獲贊 16 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章