David Velasquez
David Velasquez

Reputation: 2366

Change menu navigation icon color in xml for Android

I made a navigation icon through the Vector Asset wizard in Android Studio to place in my Toolbar. By default, the color of the image is black. It doesn't give me the option to change it in the wizard. So is there a way to change the color in xml? This is how it is set in my toolbar layout file:

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:minHeight="?attr/actionBarSize"
    app:navigationIcon="@drawable/nav_menu_icon">

</android.support.v7.widget.Toolbar>

As you can see, the image is set as app:navigationIcon="@drawable/nav_menu_icon". So is it possible to change the icon's color? I tried this solution but it wasn't working for me. The other solutions were given in code but I would like to use an xml version if possible. Also, my app is supporting API 16 and later.

Upvotes: 2

Views: 2407

Answers (1)

Oleksandr
Oleksandr

Reputation: 902

You can change color of "nav_menu_icon". Need to open nav_menu_icon.xml in studio or any editors and change the attribute "fillColor".

It's android:fillColor="#FF000000" by default.

Upvotes: 2

Related Questions