I've got an ImageView and programmatically I can change its color using imageView.setColorFilter(Color.RED)
.
There is something similar using xml??
Tint color means when we want to change the color of the image while rendering in ImageView. In XML is very easy to change tint color by just setting up the attribute android:tint="" in the ImageView tag, as shown in the following example.
XML file saved at res/values/colors.
colors. xml is an XML file which is used to store the colors for the resources. An Android project contains 3 essential colours namely: colorPrimary. colorPrimaryDark.
Yes, it's android:tint
. Here you have more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With