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

一加手机8.0适配顶部与状态栏之间有空隙 #64

Closed
5 tasks done
jackyHuangH opened this issue Oct 19, 2018 · 9 comments
Closed
5 tasks done

一加手机8.0适配顶部与状态栏之间有空隙 #64

jackyHuangH opened this issue Oct 19, 2018 · 9 comments

Comments

@jackyHuangH
Copy link

Environment

  • Autosize Version: v1.0.0
  • Target Android Version: Android 8.0
  • Device Model: Oneplus A3000(一加三)
  • Device Resolution: 1080px * 1920px
  • Design Size On AndroidManifest: 360dp * 640dp

Bug Description:

我按照文档配置,项目中首页Activity+多fragment,个人中心为activity,都出现顶部与状态栏之间有空隙,将baseOnwidth返回false依旧如此,但是另一台同分辨率的小米4(Android6.0)却正常,暂未找到解决方案

Log:

一加三:
2018-10-19 10:29:10.790 5854-5854/com.zenchn.housemonitor D/AndroidAutoSize: designWidthInDp = 360, designHeightInDp = 640, screenWidth = 1080, screenHeight = 1920
2018-10-19 10:29:10.791 5854-5854/com.zenchn.housemonitor D/AndroidAutoSize: initDensity = 2.375, initScaledDensity = 2.375
10:15:14.215 30842-30842/com.zenchn.housemonitor D/AndroidAutoSize: com.zenchn.housemonitor.mvp.main.MainActivity used the global configuration.
2018-10-19 10:15:14.217 30842-30842/com.zenchn.housemonitor D/AndroidAutoSize: The com.zenchn.housemonitor.mvp.main.MainActivity has been adapted! 
    MainActivity Info: isBaseOnWidth = true, designWidthInDp = 360.000000, targetDensity = 3.000000, targetScaledDensity = 3.000000, targetDensityDpi = 480, targetXdpi = 3.000000

小米4:
10-19 10:22:09.176 1471-1471/? D/AndroidAutoSize: designWidthInDp = 360, designHeightInDp = 640, screenWidth = 1080, screenHeight = 1920
10-19 10:22:09.176 1471-1471/? D/AndroidAutoSize: initDensity = 3.0, initScaledDensity = 2.58
10:23:07.397 1471-1471/com.zenchn.housemonitor D/AndroidAutoSize: com.zenchn.housemonitor.mvp.main.MainActivity used the global configuration.
10-19 10:23:07.397 1471-1471/com.zenchn.housemonitor D/AndroidAutoSize: The com.zenchn.housemonitor.mvp.main.MainActivity has been adapted! 
    MainActivity Info: isBaseOnWidth = true, designWidthInDp = 360.000000, targetDensity = 3.000000, targetScaledDensity = 2.580000, targetDensityDpi = 480, targetXdpi = 3.000000

Screenshot

一加三手机:
tim 20181019101549
tim 20181019101605
tim 20181019101612

小米4:
tim 20181019102441
tim 20181019102451
tim 20181019102456

Related Code:

  baseFragment中配置//今日头条屏幕适配方案配置
        AutoSizeConfig.getInstance().setCustomFragment(true);

Others:

@JessYanCoding
Copy link
Owner

JessYanCoding commented Oct 19, 2018

如果是以宽度为基准,都会出现间隙的话,那很大概率不是框架原因了,因为框架的原理并没有涉及到与 View 相关的操作,只是单纯的修改 density,修改 density 只会影响 dp 转 px 的过程,这样,你先把 AndroidAutoSize 取消依赖,看看是否还有间隙

@jackyHuangH
Copy link
Author

取消依赖是没有间隙的,高度都是match_parent,顶到顶部的

@JessYanCoding
Copy link
Owner

实现 CancelAdapt 取消有间隙的页面的适配,看看是否还有间隙

@dxy1046
Copy link

dxy1046 commented Oct 19, 2018

@jackyHuangH 你应该是使用了沉浸式状态栏吧,ImmersionBar 参考一下这个沉浸式的实现吧

@jackyHuangH
Copy link
Author

jackyHuangH commented Oct 19, 2018

@dxy1046 感谢老哥,我就是用的immer,不过没注意他更新了,已经找到解决方案了
tim 20181019134016

@JessYanCoding
Copy link
Owner

👍已更新到常见 issues 中,以便于有相同问题的人快速索引 issues

@PhonHai
Copy link

PhonHai commented Nov 5, 2018

@dxy1046 感谢老哥,我就是用的immer,不过没注意他更新了,已经找到解决方案了
tim 20181019134016

兄弟 没有这个方法啊,能不能发一下代码出来

@gyf-dev
Copy link

gyf-dev commented Nov 7, 2018

@jackyHuangH ImmersionBar更新到2.3.2-beat02版本之后,也不必使用两个参数的fitSystemWindows了

@Mac-sir
Copy link

Mac-sir commented Apr 30, 2019

初次添加使用适配没有问题,但是后面需要添加沉浸式状态栏后,在地下有一段空白(状态栏的距离)要怎么解决才好呢?

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

6 participants