Imagebutton change programmatically?

前端 未结 4 867
没有蜡笔的小新
没有蜡笔的小新 2021-02-11 12:08

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

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

         


        
4条回答
  •  情话喂你
    2021-02-11 12:39

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

     image.setBackgroundResource(R.drawable.ico);
    

提交回复
热议问题