Can I hide an image button on a layout, (dimensions and background) until a call to set visible?

前端 未结 4 1504
日久生厌
日久生厌 2021-02-06 15:45

I have a hidden image button in one of my xmls layouts, with a background set to a drawable image. I set the visibility to invisible, as I only want the image to display every

4条回答
  •  梦如初夏
    2021-02-06 16:05

    Set Visibility property of Imageview like this in java

    imgView.setVisibility(View.VISIBLE);
    imgView.setVisibility(View.INVISIBLE);
    imgView.setVisibility(View.GONE);
    

    Or like this in XML

    android:visibility="visible"
    android:visibility="gone"
    android:visibility="invisible"
    

    Result for each will be like this

提交回复
热议问题