Disable a color tint in NavigationView only for sp

2019-04-06 06:34发布

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:
enter image description here

3条回答
再贱就再见
2楼-- · 2019-04-06 06:42
 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.

查看更多
相关推荐>>
3楼-- · 2019-04-06 06:54
navview.setItemIconTintList(null);

Good luck!

查看更多
神经病院院长
4楼-- · 2019-04-06 06:56

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.

查看更多
登录 后发表回答