如何在今日扩展中显示资产目录中的图像? [英] How to display an image from Asset Catalog in Today Extension?
问题描述
我正在开发iOS8的Today Extension。我的应用程序组设置正确,我可以成功使用NSUserDefaults将简单的数据位发送到我的扩展(使用本教程)。
I'm working on a Today Extension for iOS8. My App Group is set up correctly and I can successfully use NSUserDefaults to send simple bits of data to my extension (using this tutorial).
在我的扩展程序的故事板中,我已将图像放在故事板上并将图像设置为我的资产目录中的资产。即使它出现在Interface Builder中,当我在设备和模拟器上运行应用程序时,图像也不会显示。
In the storyboard for my extension, I've placed an image onto the storyboard and set the image to be an asset I have in my Asset Catalog. Even though it appears in Interface Builder, when I run the app on a device and simulator the image doesn't display.
我缺少什么?
推荐答案
确保资产目录包含在Today分机的目标中。
Make sure the asset catalog is included in the target for your Today extension.
这篇关于如何在今日扩展中显示资产目录中的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!