user7243022
user7243022

Reputation:

how to change navigation drawer items icon

i want change navigation drawer icons and use png file but nothing displayed

i change activity_main_drawer in menu folder to this :

<group android:checkableBehavior="single">
    <item
        android:id="@+id/nav_camera"
        android:icon="@drawable/mybody"
        android:title="Import" />
    <item
        android:id="@+id/nav_gallery"
        android:icon="@drawable/weight"
        android:title="Gallery" />
    <item
        android:id="@+id/nav_slideshow"
        android:icon="@drawable/workout"
        android:title="Slideshow" />
    <item
        android:id="@+id/nav_manage"
        android:icon="@drawable/side_nav_bar"
        android:title="Tools" />
</group>

<item android:title="Communicate">
    <menu>
        <item
            android:id="@+id/nav_share"
            android:icon="@drawable/workout"
            android:title="Share" />
        <item
            android:id="@+id/nav_send"
            android:icon="@drawable/heart"
            android:title="Send" />
    </menu>
</item>

nav drawer

Upvotes: 0

Views: 1499

Answers (3)

Saim Mahmood
Saim Mahmood

Reputation: 446

You have to use a vector image, you can google and find out links to convert your png files to their respective vector image file. They have the format of .svg. After converting to include them into your android project, you have to right click on drawable and select new vector image asset. From there its pretty simple, just click on the tab which says include your own svg and browse for your file.

Upvotes: 2

nimi0112
nimi0112

Reputation: 2135

To change the icons of the items in your Navigation drawer:

  1. Download the icons in .png format in paste them in your drawable folder in all the different sizes you want.

  2. you can download some icons from here.

  3. After the icons have been put in their respective locations just specify their path in android:icon in your XML file.

Upvotes: 0

mr.android
mr.android

Reputation: 13

<dimen name="design_navigation_icon_size" tools:override="true">40dp</dimen>

Upvotes: 0

Related Questions