如何使状态栏变为带有黑色图标的白色? [英] How can I make the status bar white with black icons?

查看:136
本文介绍了如何使状态栏变为带有黑色图标的白色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改应用程序状态栏的颜色,以使其为带有黑色图标的白色(而不是默认的带有白色图标的黑色).有什么办法吗?

I want to change the colour of the status bar for my app so that it's white with black icons (instead of the default black with white icons). Is there any way of doing this?

推荐答案

使用Android M(api级别23),您可以使用android:windowLightStatusBar属性从主题中实现此目标.

With Android M (api level 23) you can achieve this from theme with android:windowLightStatusBar attribute.

就像Pdroid提到的那样,这也可以通过编程实现:

Just as Pdroid mentioned, this can also be achieved programatically:

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 

这篇关于如何使状态栏变为带有黑色图标的白色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆