how to setImage to null in android when the xml has src not null?

后端 未结 4 412
孤街浪徒
孤街浪徒 2021-01-24 19:57

I have this xml



        
4条回答
  •  北海茫月
    2021-01-24 20:33

    The background (backgroundresource) and foreground (src) image are two different things, thus the one does not influence the other.

    Remove the foreground image using:

    imageButton.setImageDrawable(null);
    

提交回复
热议问题