Imagebutton change programmatically?

前端 未结 5 1960
天命终不由人
天命终不由人 2021-02-11 12:21

I\'m trying to change the image of the ImageButton programmatically.

I\'m trying to copy this code, but the setBackgroundDrawable is already deprecated.

         


        
5条回答
  •  死守一世寂寞
    2021-02-11 12:42

    Try this its working for me,Change the background image programmatically,

     image.setBackgroundResource(R.drawable.ico);
    

提交回复
热议问题