We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Autosize Version: v1.1.0 Target Android Version: Android 6.0.1 Device Model: 网易mumu模拟器 Device Resolution: 1080px * 1920px Design Size On AndroidManifest: 1280dp * 720dp
在BaseActivity.onResume 已经调用了AutoSize.autoConvertDensityOfGlobal(this),随后也打印了app.density [1] 为480 ,我在自定ImageView中的onDraw中也打印了app.density [2] ,我重复打开关闭app ,很奇怪 [1]处 一直是正常的480。但是[2]处 却有时候会被还原回去,变回了320,导致很丑, 目前只在mumu上出现,我的测试机不多,测试机上没出现。日志的顺序一直是先打印[1]再打印[2]
The text was updated successfully, but these errors were encountered:
根据你的描述,我暂时没理解你描述的 app.density [1] [2] 指的是什么?不过如果是 density 在某些设备上被恢复成初始值,这是有可能发生的,因为 density 的修改是全局的,搞不好某个定制系统的某处代码就会修改 density,有些系统则很稳定,所以关于今日头条适配方案的万能解决方案就是,在布局显示到屏幕之前那一刻将 density 修改为你期望的值,哪怕你显示完的后一秒将 density 继续修改为其他值,但这不会影响已经显示的布局,#13 (comment) ,AndroidAutoSize 收到的 100 多个 issues 至少百分 80 都和这个问题相关,也都可以通过这个方式解决问题,你的问题出在没找准调用 autoConvertDensityOfGlobal 的时间点,而不是这个方案无效,你在 BaseActivity.onResume 中调用了,但是调用之后 density 又被系统修改回去,则照样无法适配,这个调用时机就靠你自己找了,环境和系统只有你最清楚,Android 系统、虚拟机这么多,我一个人的精力不可能做到找到所出系统出问题的原因
Sorry, something went wrong.
No branches or pull requests
Environment
Autosize Version: v1.1.0
Target Android Version: Android 6.0.1
Device Model: 网易mumu模拟器
Device Resolution: 1080px * 1920px
Design Size On AndroidManifest: 1280dp * 720dp
Bug Description:
在BaseActivity.onResume 已经调用了AutoSize.autoConvertDensityOfGlobal(this),随后也打印了app.density [1] 为480 ,我在自定ImageView中的onDraw中也打印了app.density [2] ,我重复打开关闭app ,很奇怪 [1]处 一直是正常的480。但是[2]处 却有时候会被还原回去,变回了320,导致很丑, 目前只在mumu上出现,我的测试机不多,测试机上没出现。日志的顺序一直是先打印[1]再打印[2]
The text was updated successfully, but these errors were encountered: