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

在MIUI13 (Android 12)系统上工具类在Release模式下不可用 #50

Open
cfanboy opened this issue Jan 19, 2022 · 1 comment
Open

Comments

@cfanboy
Copy link

cfanboy commented Jan 19, 2022

经测,在小米K40 Pro+手机(MIUI 13.0.5, Android 12)上,如使用Release模式运行:flutter run --release

screenWidth, screenHeight, statusBarHeight, bottomBarHeight, appBarHeight等基础属性全为0,间接导致几乎所有方法均返回为0,如getSp

@cfanboy cfanboy changed the title 在MIUI13 (Android 12)系统上工具类不可用 在MIUI13 (Android 12)系统上工具类在Release模式下不可用 Jan 19, 2022
@hzysky
Copy link

hzysky commented Aug 10, 2022

1.建议使用ScreenUtil.getScreenW(context)
iOS 同样出现这种情况
2.在初始化的时候 延迟获取 screenWidth, screenHeight, statusBarHeight, bottomBarHeight, appBarHeight 然后保存下来

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