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:
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
navview.setItemIconTintList(null);
Good luck!
回答2:
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.
回答3:
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.