I have a RelativeLayout
with a thin red frame background and a (mostly transparent) ImageView
as a child. Their sizes are equal:
On screen it looks as follows:
When user presses this compound object, I want to change frame's color to green:
I set RelativeLayout
's background to a StateListDrawable
that switches red to green. It works fine until I add a child ImageView
(representing blue letter "A") to the RelativeLayout
. This ImageView intercepts input touches and therefeore blocks input. I tried to call
imageView.setEnabled(false);
imageView.setFocusable(false);
relativeLayout.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
but nothing helped.
How do I make an ImageView "transparent" to input events?