user10885821
user10885821

Reputation:

Navigation Drawer showing only black icons

I want to change navigation drawer icons, i am trying below code in Menu.xml file. But it showing only black icon.

<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".Welcome"
tools:showIn="navigation_view">

<group android:checkableBehavior="single">
    <item
        android:id="@+id/nav_kirtan"
        android:icon="@drawable/point_red"
        android:title="XYZ"/>
</group>

Expected output -

enter image description here

Please help me...!

Upvotes: 0

Views: 1110

Answers (2)

VikaS GuttE
VikaS GuttE

Reputation: 1704

Add below line in Activity class...

mNavigationView.setItemIconTintList(null);

Upvotes: 6

Vaibhav singh
Vaibhav singh

Reputation: 101

Try to add color like this :

 <item
        android:id="@+id/nav_kirtan"
        android:icon="@drawable/point_red"
        android:title="XYZ"
        android:tint="@color/redColor"
/>

or you can also do

  mNavigationView.setItemIconTintList(null);

This disables all state based tinting.

Upvotes: 1

Related Questions