Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 608
Imama Avatar asked Oct 08 '16 12:10

Imama


People also ask

How do you get the drawer icon color?

Changing the Icon Color To change the drawer icon color in Flutter: Simply add the iconTheme property inside the AppBar widget and assign the IconThemeData(color: [your_color]).

How do you display the badge on the navigation drawer menu icon?

Use BadgeDrawerArrowDrawable to provide a badge and/or count to the hamburger icon. To use BadgeDrawerArrowDrawable with DrawerLayout following code snippet can help. To display only Badge icon enable the badge and set the text to null.


1 Answers

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

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setItemIconTintList(null);
like image 99
user5968678 Avatar answered Sep 28 '22 06:09

user5968678