iPhone Interface Builder - 将资源移至子目录,现在 IB 看不到它们!
我的 Xcode 项目中有一堆图像。它们最初是在没有选择“为任何添加的文件夹创建文件夹引用”的情况下添加的。因此,我删除了引用并按照这些说明重新添加 包含资源不幸
的是,Interface Builder 不会显示该目录中的任何图像。在项目树上,目录出现一个蓝色图标,所有文件都在那里!
文件名显示在 IB 检查器中(即在“图像”属性下),但我缺少该目录中所有内容的图像图标。
有什么想法如何让图像再次显示吗?
I had a bunch of images in my Xcode project. They were originally added without choosing "Create Folder References for any added folders". So I removed the references and re-added as per these instructions Include a resource directory hierarchy into app bundle
Unfortunately, Interface Builder will not display any of the images inside that directory. On the project tree the directory comes up with a blue icon and all the files are there!
The file names show in the IB Inspector (i.e. under the 'Image' property), but I get missing image icons for everything located in that directory.
Any ideas how to get the images showing again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题解决了!事实证明,蓝色文件夹引用没问题,但 IB 不会阅读它们!
对于任何其他想知道的人,如果您有以下内容:
一旦您将它们添加到 Xcode 中的蓝色文件夹中(如上面的链接中详细介绍),您可以在 IB 中引用它们,如下所示:
在 XIB 的 XML 中,它将看起来像这样
简单!唯一的缺点是 Interface Builder 的所见即所得预览不处理这些路径!
我在这里找到了答案 http://www.iphonedevsdk.com/forum/iphone-sdk-development/6457-xcode-folder-directories.html iphonedevsdk.com/forum/iphone-sdk-development/6457-xcode-folder-directories.html
Problem solved! Turns out that blue folder references are fine, but IB will not read them!
For anyone else who cares to know, if you have the following:
Once you've added them in a blue folder in Xcode (as detailed in link above), you can refer to them in IB as follows:
In the XIB's XML it will look something like this
Simple! The only drawback is Interface Builder's WYSIWYG preview does not process these paths!
I found the answer here http://www.iphonedevsdk.com/forum/iphone-sdk-development/6457-xcode-folder-directories.html
如果您希望在 SCM 和 XCode 下构建图像,但实际上并不介意在构建最终的 .ipa 包后所有图像都将放置在一个目录中,那么您需要执行以下操作:
现在,您可以从 Interface Builder 中选择图像,而无需在其前面添加文件夹名称前缀,并且您将在 Interface Builder 中看到图像的预览。
在设计应用程序时,为我提供 IB 预览和整洁的文件夹结构。
If you like to have your images structured in your SCM and under XCode but really doesn't mind that all images will be placed in one directory once building the final .ipa package, here is what you need to do:
From Interface Builder you are now able to pick your images without prefixing it with the folder name and you will see a preview of your images within Interface Builder.
Gives me both my IB preview and a neat folder structure when designing my app.
结束
Finish