I have an ImageButton and a LinearLayout wrapping that button, like this:
I think the questioner is dead by now :XD
but this is the solution
add this two lines of code to your layout:
android:clickable = "true"
and
android:focusable = "true"
the main sample is
we have this constraint layout like :
and the ( layout_selector.xml ) like this :
and for ( bg_pressed.xml ) and ( bg_focused.xml ) and ( bg_default.xml ) as we used in selector before we need to declare them in drawable folder like :
bg_pressed.xml :
bg_focused.xml :
bg_default.xml :
now put your image view or something else inside the layout and try some clicks :) (read the question!)
hope this will help you ...