I'd like to know if a ColorFilter
can be set in the XML of a View
or if the only way is to use setColorFilter()
in Java.
There is; it's called tint. It's not available on View
but is on ImageView
and ImageButton
.
If you want to use it with a selector
this answer helped me a bunch.
You can use:
android:tint="@color/white"
According to the documentation http://developer.android.com/reference/android/graphics/ColorFilter.html there is no corresponding xml version for ColorFilter.
I also searched for attributes in documentation with the keys 'color' and 'filter' http://developer.android.com/reference/android/R.attr.html
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