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

前端 未结 4 1596
日久生厌
日久生厌 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:11

    All views, including ImageButton, inherit from android.view.View, so they all have a visibility attribute that can be set. Instead of setting the visibility of the drawable resource, set it on the ImageButton.

提交回复
热议问题