johanjohansson
johanjohansson

Reputation: 541

How do I change the color of the navigation bar icons? (Android studio)

To avoid confusion as to what the navigationbaractually is, here's a picture

As you can see, I've added a new color instead of the standard black color using:

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

But the icons are barely visible now, so I would like to change them into being black, or at least darker. I have searched SO and the webb but came up empty handed. Any ideas?

Upvotes: 5

Views: 7623

Answers (1)

Ron Nabuurs
Ron Nabuurs

Reputation: 1556

You cannot change the color of the buttons yourself. However you can try to set the navigationbarlight to true. It should be noted that this is only available from API level 27.

windowLightNavigationBar added in API level 27

int windowLightNavigationBar

If set, the navigation bar will be drawn such that it is compatible with a light navigation bar background.

For this to take effect, the window must be drawing the system bar backgrounds with windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with windowTranslucentNavigation. Corresponds to setting SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR on the decor view.

May be a boolean value, such as "true" or "false".

source

Upvotes: 6

Related Questions