Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setDarkMode 和 setLightMode 会使 布局向上偏移,设置fitsSystemWindows会使Edittextview长按上下文菜单边距失效 #291

Open
limengxin opened this issue Jun 11, 2020 · 2 comments

Comments

@limengxin
Copy link

如题

@limengxin
Copy link
Author

现在我没设置fitsSystemWindows,解决方法暂时是 手动设置一个contentView.setPadding(0, statusBarHeight, 0, 0)

@yswheye
Copy link

yswheye commented Dec 10, 2021

`

@TargetApi(Build.VERSION_CODES.M)
public static void setLightMode(Activity activity) {
setMIUIStatusBarDarkIcon(activity, true);
setMeizuStatusBarDarkIcon(activity, true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}

@TargetApi(Build.VERSION_CODES.M)
public static void setDarkMode(Activity activity) {
    setMIUIStatusBarDarkIcon(activity, false);
    setMeizuStatusBarDarkIcon(activity, false);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    }
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants