How to draw the same png icon in different colors?

72 Views Asked by At

I have an image template that contains on the top of a transparent background a white only icon. How can I draw this icon with differents color (ex: blue, yellow, etc.)? For example I would like to print it in yellow at someplace and in blue at another place.

1

There are 1 best solutions below

0
ashakirov On
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/icon"
    android:tint="@color/tint_color" />

Result with red and yellow tint colors:

result

Also there are several setColorFilter methods in ImageView. Check this post