模拟器中未显示 UIBUTTON 图像

uibutton image not shown in simulator

提问人:Mor Goren 提问时间:1/19/2021 更新时间:1/19/2021 访问量:64

问:

我试图用图像和文本做一个uibutton,在xib中它看起来很好,但在模拟器中图像丢失了,我不知道为什么。

XIB:

enter image description here

UIBuint 设置:

enter image description here

enter image description here

模拟器的外观:

enter image description here

Objective-C UIbutton UIImistion UILimal UIIoperic)

评论

0赞 skaak 1/19/2021
试着把它弄大一点。例如,将最高值定为 30,看看会发生什么。
0赞 Mor Goren 1/19/2021
什么都没有改变

答:

0赞 Mahboob Nur 1/19/2021 #1

简单的方法是使用界面构建器获取 UIView 并添加 UIImageView,UILabel 作为 SubView。然后在整个 UIView 上添加一个透明按钮。我希望你的问题能得到解决。