5

This is what my bottom navigation bar looks like at the moment:

enter image description here

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:

...
<!-- 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.

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?

Zain
  • 37,492
  • 7
  • 60
  • 84
JamieRhys
  • 206
  • 6
  • 24

5 Answers5

0

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:

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

screenshot

Vadik Sirekanyan
  • 3,332
  • 1
  • 22
  • 29
0

You could make it lighter only

0

Please try to this

 <item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
0
<item name="android:windowLightNavigationBar">true</item> 

should be right. but you said it doens't work. So I assumed there is another theme on your activity.

So, I sugest, in your activitiy or fragment code, how about set window flag directly. try code below . It will make your icon dark

activity.window.decorView.systemUiVisibility = (
                or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
                or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
0

You're in the themes.xml file- have you tried adding this to the styles.xml file?

<item name="android:navigationBarColor">@color/black</item>

Also, this Styles and Themes page might help you out! They have a comparison and pretty good explanations with examples. For example, you can customize the default theme that you're using like this:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
dko
  • 197
  • 8