N
N
newdancer2015-08-31 01:44:28
Java
newdancer, 2015-08-31 01:44:28

How to set highlight color for imageview?

How to set highlight color for imageview? For example, for each imageview there is a corresponding picture. How to make selection of entire imageview with yellow tint (like when clicking button button)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tiberal, 2015-08-31
@Tiberal

For example, set a selector, or override the onTouch method for the view, detect a click on it and call something like this

iv.getDrawable().setColorFilter(цвет,PorterDuff.Mode.SRC_ATOP);
iv.invalidate();

then detect release and call
image.getDrawable().clearColorFilter();
image.invalidate();

to deselect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question