Change source image for image view when pressed

前端 未结 16 591
闹比i
闹比i 2020-12-08 19:53

I have a scroll view with lots of image buttons. I want to change the image for an image button when it\'s pressed. The thing is that I want the image to remain until anothe

16条回答
  •  生来不讨喜
    2020-12-08 20:44

    Demo_button.setImageResource(R.drawable.secondimage)
    
    //Demo_button is your event holder (the button or imageview or bitmap file which contains the image) and secondimage is your image (drawable) file, without any complications.
    

    This does the trick.

提交回复
热议问题