public void setStatusBar(boolean isDrakMode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window win = getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
boolean on = true;
if (on) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
}
win.setAttributes(winParams);
setStatusBarDarkMode(isDrakMode, this);
}
}
Android 沉浸式状态栏
最新推荐文章于 2024-08-08 04:20:45 发布