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

Fragment中有图片,想要设置沉浸状态栏的颜色为黑色 #255

Open
QianHong opened this issue Dec 29, 2018 · 4 comments
Open

Comments

@QianHong
Copy link

1.5.1修改后怎么使用的?我是mainactivity+4fragment,里面有一个fragment顶部是图片。
由于状态栏底色是白的所以想把字体什么的设成黑色的。
使用:
StatusBarUtil.setTranslucentForImageViewInFragment(MainActivity.this, 0, null);
StatusBarUtil.setLightMode(this);
但是没有效果,状态栏的字体是黑的,但是沉浸式效果不见了。

@thsai
Copy link

thsai commented May 24, 2019

同样遇到了这个问题 请问你怎么解决的

@thsai
Copy link

thsai commented May 27, 2019

StatusBarUtil.setLightMode(this);该方法里少了个View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN flag,
不要调用这个方法,改为如下两行
StatusBarUtil.setTranslucentForImageViewInFragment(MainActivity.this, 0, null); getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
搞定

@codingmancui
Copy link

StatusBarUtil.setLightMode(this);该方法里少了个View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN flag,
不要调用这个方法,改为如下两行
StatusBarUtil.setTranslucentForImageViewInFragment(MainActivity.this, 0, null); getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
搞定
也是无效的

@walterFeng
Copy link

#280 中,
对沉浸式状态栏做了兼容
见demo LightModeActivity.java

@QianHong @thsai

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

4 participants