Android: How to propagate click event to LinearLayout childs and change their drawable

后端 未结 5 1740
灰色年华
灰色年华 2021-01-31 10:05

I would like to create a linear layout which would behave similarly to ImageButton.



        
5条回答
  •  醉酒成梦
    2021-01-31 10:44

    Put

    android:duplicateParentState="true"
    

    in your ImageView and TextView..then the views get its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.

提交回复
热议问题