简体   繁体   English

界面构建器UIButton自定义背景图像无法在模拟器/设备上运行

[英]Interface builder UIButton custom background image not working on simulator/device

I'm trying to do something really simple. 我正在尝试做一些非常简单的事情。 I have an image for a button and I'm trying to set it on a custom button in interface builder. 我有一个按钮的图像,我试图在界面生成器中的自定义按钮上设置它。 I set the background image accordingly (no case sensitivity problem here). 我相应地设置了背景图像(这里没有区分大小写问题)。 In interface builder it shows up, but in the simulator or on the device it doesn't appear at all. 它在界面构建器中显示,但在模拟器或设备上它根本不显示。 Just the button's text will appear. 只显示按钮的文字。 Do I need to turn on some flag or something of the sort? 我需要打开一些旗帜或类似的东西吗?

I found the problem. 我发现了这个问题。 It wasn't being linked with the Target's Copy Bundle Resources. 它与Target的Copy Bundle Resources没有关联。 I don't think I ever had to do this for other resources. 我认为我不必为其他资源做这件事。

Shouldn't this be done automatically when you add it to the Resources of the project? 将它添加到项目的资源时,不应该自动完成吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM