How to make button with custom background image show click animation in Android

前端 未结 5 1468
無奈伤痛
無奈伤痛 2020-12-05 16:27

How to make button show it is clicked (by setting it go down/some change) for buttons using custom background image in Android. I do not want to include more images and set

5条回答
  •  旧时难觅i
    2020-12-05 17:10

    just wanna add another easy way to do this: If your ImageButton remains its background and you don't set it to null, it will work like a normal button and will show the click animation while clicking exactly like other buttons.The way to hide the background while it is still there:

    
    

    the paddings won't let the background be visible and make the button act like other buttons.

提交回复
热议问题