Remove background drawable programmatically in Android

前端 未结 11 1564
忘掉有多难
忘掉有多难 2020-12-07 17:17

I want to remove the background drawable @drawable/bg programmatically. Is there a way to do that?

Currently, I have the following XML in my layout:

11条回答
  •  星月不相逢
    2020-12-07 17:52

    First, you have to write in XML layout:

    android:visibility="invisible" 
    

    then use this to show it using Java:

    myimage.setVisibility(SHOW); //HIDE
    

提交回复
热议问题