Imama Imama - 7 months ago 35
Android Question

How to show original color of icon in Android Navigation drawer?

I created a new Android Studio project and seleced Navigation drawer activity

In activity_main_drawer.xml I changed the icon path to a file in drawable folder as below

<item
android:id="@+id/nav_camera"
android:icon="@drawable/nav_logo_premium"
android:title="Import" />


It changed the icon. but It does not show original color. It shows as ash color I think I need to change the theme. after spending hours I could not find the solution.

I really appreciate any kind of help.


Because i did not change code I did not attached all files source code
here


Please see attached screenshot
Screenshot

Answer Source

Force NavigationView to stop tinting the icons in MainActivity.java:

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