Show ImageView programmatically

前端 未结 4 685
北荒
北荒 2020-12-05 01:51

How can I make an ImageView appear in the middle of the screen when the user clicks a button? I have placed the image in the res/drawable-folder.

I\'ve been trying w

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 02:03

    • Create the ImageView
    • Use an OnClickListener in the button
    • Add the ImageView to the layout or set the visibility of the ImageView to VISIBLE

提交回复
热议问题