[英]How can I make the status bar white background with black icon?
我想在我的应用程序状态栏中使带有黑色图标的白色背景
I don't know of any way to make the icons black , but you can add these attributes to your activity's theme to get a white status bar with dark gray icons: 我不知道使图标变黑的任何方法,但是您可以将这些属性添加到活动的主题中,以获得带有深灰色图标的白色状态栏:
<item name="android:statusBarColor">#fff</item>
<item name="android:windowLightStatusBar">true</item>
Note that statusBarColor
is api 21+ only, and windowLightStatusBar
is api 23+ only, so perhaps you'd be best to put these in a res/values-v23/styles.xml
so that you don't have a white status bar with white icons on api 21 and 22. 请注意,
statusBarColor
仅适用于api 21+,而windowLightStatusBar
仅适用于api 23+,因此,也许最好将它们放在res/values-v23/styles.xml
以免白色状态栏带有api 21和22上的白色图标。
I've read elsewhere on this site that these attributes are not honored by some vendor-specific versions of the OS, including Motorola and Mi phones. 我在该站点的其他地方读到,某些操作系统的特定于供应商的版本(包括摩托罗拉和Mi手机)不具备这些属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.