Android 隐藏系统状态栏

通常的做法是这样的:

private static boolean isStatusbarVisible(Activity activity) {
int uiOptions = activity.getWindow().getDecorView().getSystemUiVisibility();
boolean isStatusbarHide = ((uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN) == uiOptions);
return !isStatusbarHide;
} public static void hideStatusBar(Activity activity) {
if (isStatusbarVisible(activity)) {
int uiOptions = activity.getWindow().getDecorView().getSystemUiVisibility();
uiOptions |= View.SYSTEM_UI_FLAG_FULLSCREEN;
activity.getWindow().getDecorView().setSystemUiVisibility(uiOptions);
}
}

此方法大多数情况都能奏效,但是遇到Drawerlayout就歇菜了。目前还没有找到解决办法。

上一篇:什么才是定制化IDE的核心价值?


下一篇:python sqlite 查询表的字段名 列名