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

老哥,请问状态栏能沉浸吗? #4

Open
SaltedFish-Extreme opened this issue Jul 21, 2023 · 10 comments
Open

老哥,请问状态栏能沉浸吗? #4

SaltedFish-Extreme opened this issue Jul 21, 2023 · 10 comments

Comments

@SaltedFish-Extreme
Copy link

和我页面上的状态栏图标颜色一致,或者像下面一面弄一层遮幕也行,现在弹窗会使状态栏图标变白色😂

image

image

@javakam
Copy link
Owner

javakam commented Jul 21, 2023 via email

@SaltedFish-Extreme
Copy link
Author

嗯,我用的就是ImmersionBar,给这个示例的CustomBottomDialog用的,但是还是不行,没效果😂

@SaltedFish-Extreme
Copy link
Author

我就是想 日间模式的时候,状态栏图标黑色,夜间模式的时候,状态栏图标白色,状态栏沉浸,但是我设置了

immersionBar(dialog) {
                    navigationBarColor(R.color.white_smoke)
                    statusBarDarkFont(true, 0.2f)
                    navigationBarDarkIcon(true, 0.2f)
                    init()
                }

弹出底部弹窗的时候,状态栏字体还是白色的😂

@SaltedFish-Extreme
Copy link
Author

还有老哥,为啥要隐藏虚拟导航栏啊?感觉弹出底部弹窗的时候,底部导航栏隐藏动画有点卡顿😂

@javakam
Copy link
Owner

javakam commented Aug 1, 2023

捣鼓半天好像Dialog还真没法改动状态栏字体颜色... 试了下在布局里做个半透明, 又因为有动画导致呈现效果也不好, 建议直接做成Dialog样式的Activity, 朴实无华

@SaltedFish-Extreme
Copy link
Author

😂唉,我记得DialogFragment应该可以吧,状态栏沉浸框架对fragment也可以,每次创建的时候沉浸一下就行

@javakam
Copy link
Owner

javakam commented Aug 2, 2023

@SaltedFish-Extreme
Copy link
Author

😂老哥,我刚才找着一个取消背景蒙层变黑效果的方法,可以使状态栏不变色,但是背景变黑的效果就没有了,在你这个CustomBottomDialog里使用,好像没有效果,不知道是不是你定义过,不能再修改不了

https://blog.csdn.net/ldxlz224/article/details/103508730

image

@javakam
Copy link
Owner

javakam commented Aug 2, 2023

不建议这种方案, 这种方式应该是设置了 window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) 去掉了蒙层效果。直接new Dialog产生的蒙层也是这样的, 没法控制

@SaltedFish-Extreme
Copy link
Author

嗯,唉,要是能直接通过dialog设置状态栏颜色就好了😂

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