您的位置:首页 > 其它

设置系统栏可见性

2016-06-02 12:28 260 查看
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);

   }

  }

 }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: