I need to disable a tint color for some icons in NavigationView
because their color define category type. How can I do it?
Below picture shows my problem:

- 7,277
- 11
- 56
- 123
-
Did you find a solution? – Thomas Vos Oct 06 '16 at 15:36
-
No, unfortunately. – Denis Sologub Oct 10 '16 at 04:01
-
@Wax have you found the solution yet? I need to use two colors to one item and the rest grey.. – sanjeev Apr 05 '18 at 17:14
-
@sanjeev I don't remember already, honestly, but seems u can only prepare few ColorTintLists and set got each item manually (in code) – Denis Sologub Apr 05 '18 at 17:17
-
@Шах yeah we could do that.. but how do you set the default icon color for the selected one? are you telling me its not possible? – sanjeev Apr 05 '18 at 17:30
-
Also it wouldn't be possible to use multiple colors in ColorTintLists for a single checked item sadly right? – sanjeev Apr 05 '18 at 17:32
-
@sanjeev yeah, of course, u can set it as u want – Denis Sologub Apr 05 '18 at 17:46
5 Answers
navview.setItemIconTintList(null);
Good luck!

- 9,572
- 2
- 32
- 53

- 1,329
- 12
- 14
-
2
-
Sorry, my bad. Then you can use a selector like that : http://stackoverflow.com/questions/30967851/change-navigation-view-item-color-dynamicly-android – Robert Banyai Apr 02 '16 at 09:36
-
My problem that I need to use tint not for all items, only for specified which doesn't define some category. `ColorTintList` applies to all items in `NavigationView`. – Denis Sologub Apr 02 '16 at 09:39
-
1Did you tried to get your menu item programatically, and modify the item's tint? – Robert Banyai Apr 02 '16 at 09:50
-
I try to set `ColorTintList` in `null` in `NavigationView` and use `DrawableCompat` to tint icons when I create menu but it doesn't work. All my icons became a black. – Denis Sologub Apr 02 '16 at 09:52
If you want change color of icon on seletion the below is the possible answer:
Change Navigation View Item Color Dynamicly Android
Otherwise you can set
navview.setItemIconTintList(null);
this will give the original colors of icons. and you can use colored and grey icons as per your requirements.

- 1
- 1

- 8,956
- 2
- 21
- 35
-
-
-
-
Now, I'll post a picture to it be understandable (Don't know how to say in English) – Denis Sologub Apr 02 '16 at 09:43
In case this is still relevant for somebody, we found a solution for a similar issue recently.
Although it is not possible (at least on API levels < 26) to set a custom tint list on individual items, you can set the tint mode individually. This worked for us:
val itemsWithoutTint: List<Int> = listOf(12345)
for (i in 0 until getMenu().size()) {
val item = getMenu().getItem(i)
if (item.itemId in itemsWithoutTint) {
MenuItemCompat.setIconTintMode(item, PorterDuff.Mode.DST)
}
}
By setting the TintMode to DST (https://developer.android.com/reference/android/graphics/PorterDuff.Mode), the source (in this case the tint color) is ignored and the destination (the icon to be tinted) is left untouched.

- 109
- 1
- 1
For those who are using Kotlin, That's how it is done
val bottomNavigationView: BottomNavigationView = findViewById(R.id.bottomnavigationhome)
// * THIS ONE
bottomNavigationView.itemIconTintList = null

- 459
- 6
- 17
Menu menuNav = navigationView.getMenu();
MenuItem menuItem = menuNav.findItem(R.id.nav_subjects);
// Disable a tint color
menuItem.setChecked(false);
I hope it answers your question.

- 1
- 1
- 2