uibutton 图像未显示在模拟器中

问题描述

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

xib:

enter image description here

uibutton 设置:

enter image description here

enter image description here

模拟器中的外观:

enter image description here

解决方法

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...