@Override public void onConfigurationChanged(Configuration newConfig) { if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ) {//横屏 int flag = WindowManager.LayoutParams.FLAG_FULLSCREEN; Window window = getWindow(); window.setFlags(flag, flag); } else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ) { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } super.onConfigurationChanged(newConfig); }
横屏隐藏状态栏,竖屏显示状态栏
最新推荐文章于 2020-03-28 23:39:21 发布