Zackratos / UltimateBarX

Make Android transparent statusbar and navigationbar easy.
Apache License 2.0
1.56k stars 166 forks source link

Android10 状态栏会出现灰色遮罩,导航栏不会,看起来和历史issue应该是一个问题 #42

Closed yyj001 closed 3 years ago

yyj001 commented 3 years ago

UltimateBarX.with(this) .transparent() .light(true) .applyStatusBar()

download

Zackratos commented 3 years ago

什么手机,用的哪个版本

yyj001 commented 3 years ago

一加7 pro, 刚刚换了0.7.1版本,试了一下还是有遮罩

yyj001 commented 3 years ago

UltimateBarX.statusBar(this) .transparent() .color(Color.TRANSPARENT) .colorRes(Color.TRANSPARENT) .light(true) .apply()

Zackratos commented 3 years ago

这个跟 issues5 应该不是同一个问题, issues5 说的是导航栏有遮罩,而你的是状态栏,我感觉应该是你用了其他的状态栏的库的方法或者是代码里加了

window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)

上面的代码在 Android 5.0 以上会导致状态栏有遮罩

Zackratos commented 3 years ago

issues5 的遮罩是 Android 10 以上才有的,你也可以换个低版本的手机看一下是不是还有遮罩,如果还有,就说明不是同一个问题

yyj001 commented 3 years ago

Android 8的手机上测没有遮罩😂,我可以再研究一下

yyj001 commented 3 years ago

问题是由于在style添加了 <item name="android:windowTranslucentStatus">true</item>引起

Zackratos commented 3 years ago

问题是由于在style添加了 <item name="android:windowTranslucentStatus">true</item>引起

不应该啊,我会重新给他设为 false,我再看一样