ImageButton doesn't highlight on click with Transparent background

前端 未结 4 1791
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-05 00:00

I\'ve set up an ImageButton to be transparent, so the icon matches the backgrond panel like the Android ActionBar. This looks fine as I want it to.

However, when the

4条回答
  •  孤街浪徒
    2020-12-05 00:31

    I came across this same problem. Finally, I got a sample of a code with that attribute:

    android:background="?android:selectableItemBackground"
    

    This attibute will give a transparent background with selectable highlight to any View (Button, ImageButton, TextView...) WITHOUT MORE CODING!!!

提交回复
热议问题