简体   繁体   English

更改底部导航栏图标颜色?

[英]Changing bottom navigation bar icon colour?

This is what my bottom navigation bar looks like at the moment:这是我现在底部导航栏的样子:

在此处输入图片说明

Looks great right?看起来很棒吧? Except that, right now you can see each icon clearly (or mostly clearly), however when you view it on my device you can barely make out the icons at all.除此之外,现在您可以清楚地(或大部分情况下)看到每个图标,但是当您在我的设备上查看它时,您几乎看不到这些图标。

I have the following in my themes.xml at the moment:目前我的themes.xml中有以下内容:

...
<!-- Navigation bar colour. -->
<item name="android:navigationBarColor">@color/pink</item>
<item name="android:windowLightNavigationBar">false</item><!-- This does nothing -->
...

At the moment my minSdkVersion is 29 and my targetSdkVersion is 30.目前我的minSdkVersion是 29,我的targetSdkVersion是 30。

How could I change the icons colour, or if that's not possible, at least have them a darker colour so they can be viewable?我怎么能改变图标的​​颜色,或者如果不可能,至少让它们颜色更深,这样它们就可以看到了?

You can't change color of navigation bar icons.您无法更改导航栏图标的颜色。 But you can make it dark or light.但是你可以让它变暗或变亮。 Your pink navigation bar looks pretty light.你的粉红色导航栏看起来很轻。 So, set windowLightNavigationBar to true :因此,将windowLightNavigationBar设置为true

<item name="android:windowLightNavigationBar">true</item>

截屏

你只能让它更轻

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM