how to replace/change image button programmatically android

前端 未结 4 562
天命终不由人
天命终不由人 2021-02-08 21:12

I have an image button on my view which i need to change after user interaction. I dont find nothing like myImageButton.setDrawable Here is my xml for the button i

4条回答
  •  花落未央
    2021-02-08 22:02

    ImageButton = (ImageButton)findViewById(R.id.stopButton);
    btn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.btn_stop, 0, 0, 0);
    

提交回复
热议问题