Search code examples
androidnavigation-drawertint

Changing the icon colour of individual Navigation Drawer icons


This question has been asked before in comments on other threads but no-one has ever got a straight answer as far as I can see.

What I'm looking to do is style every individual icon in a nav draw to be tinted with different colours. Here's an example:

The example

Using app:itemIconTint will style all icons. Is there a possible way to do this?


Solution

  • In onCreate() method put this:

    NavigationView nw = (NavigationView) findViewById(R.id.nav_view); nw.setItemIconTintList(null);

    and then all your icons will be shown in their original color. Basically all you need to create are colored icons.