Sampada
Sampada

Reputation: 129

How to add icons to titles in navigation Drawer?

How can we change the default camera,gallery etc. icons in navigation drawer ?I tried changing in the activity_main_drawer.xml from <item android:id="@+id/history" android:icon="@drawable/ic_menu_camera" android:title="History" />

to <item android:id="@+id/history" android:icon="@drawable/history" android:title="History" /> But this doesn't work.It shows me a black square icon in its place . How to change that ? enter image description hereenter image description here

Upvotes: 1

Views: 751

Answers (1)

Eugen Pechanec
Eugen Pechanec

Reputation: 38223

The icon is colored semi transparent black when not active and primary color when selected. This is a feature. Use shape and transaprency to convey meaning, similar to notification icon.

This is a good example:

Good example

This is a bad example:

Bad example

Seeing from the preview your icons have solid white background instead of transparent.

Upvotes: 1

Related Questions