Android – Navigation View item menu background color

You don’t set the drawable for the background of a Navigation View item in your styles.xml file. Open up your XML layout file containing your Navigation View widget, and add the following line to the widget’s attributes:

app:itemBackground="@drawable/activated_background.xml"

If you’re having trouble with the “app” pointer, add the following line in as well:

xmlns:app="http://schemas.android.com/apk/res-auto"

Note that this only changes the colour of the background of a selected list item. If you’d like the icon and text colour to change as well, use the app:itemTextColor attribute instead.

Leave a Comment