Android highlight an imagebutton when clicked

后端 未结 5 874
执笔经年
执笔经年 2021-01-31 05:06

I am using an ImageButton. But I don get the highlight when clicked. I googled and many suggested to use selector where another image is displayed. Is there any way

5条回答
  •  囚心锁ツ
    2021-01-31 05:23

    In order not to have to set several drawable for each button I set the color filter attribute of the image button in an on touch listener.

    See code here in another post:

    https://stackoverflow.com/a/14278790/891479

提交回复
热议问题