Why does resource bundle copy .png as .tiff images?(为什么资源包将 .png 复制为 .tiff 图像?)
问题描述
我创建了一个静态库和一个资源包,用于跨多个项目重用代码和资产.
I've created a static library and a resource bundle for reusing code and assets across several projects.
在静态库中,我有一个管理器类,其唯一目的是创建其他 UIViewControllers
,其视图是从 .xib
文件创建的(使用常见的 initWithNibName:bundle:
方法).
Within the static library, I have a manager class whose sole purpose is to create other UIViewControllers
, whose views are created from .xib
files (using the common initWithNibName:bundle:
method).
当我在 Interface Builder 中创建视图时,图像会正确显示.但是,当我在模拟器上运行应用程序时,我收到此错误:
When I create the view in Interface Builder, the images show correctly. However, when I run the app on the simulator, I get this error:
Could not load the "<image_name.png>" image referenced from a nib in the
bundle with identifier "com.<my_company>.<app_identifer>"
经过几个小时的打磨,我终于检查了资源包,发现 .png 文件不在其中!取而代之的是 .tiff 同名文件(不包括 @2x 版本).
After hours of grinding, I finally inspected the resources bundle, and I found that the .png files weren't in it! Instead, .tiff files of the same name (excluding @2x versions) were there instead.
所有图片都包含在 复制捆绑资源 下的捆绑包构建阶段,并且我已在其他 iOS 项目中使用过这些图片(因此它们不会损坏).
All of the images are included within the bundle's build phase under copy bundle resources , and I've used the images on other iOS projects (so they're not corrupted).
有其他人经历过吗?假设图像将始终作为 .tiff 添加到捆绑包中是否安全?(如果是这样,将界面生成器中的图像名称更改为 .tiff 是否安全?)还是我在这里做错了什么?
Has anyone else experienced this? Is it safe to assume that the images will always be added to the bundle as .tiff? (And if so, is it safe to just change the image name in interface builder to .tiff?) Or am I doing something incorrect here?
提前感谢您的帮助.
推荐答案
关于资源包的问题,请参考这个链接,因为它有几个类似的问题.
For the issue of resource bundles , refer to this link as it has a couple of similar faced queries.
转换资源包
告诉我哪个答案真正帮助您解决了这个问题.谢谢.
Tell me which answer really helped you solve this issue. Thanks.
这篇关于为什么资源包将 .png 复制为 .tiff 图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么资源包将 .png 复制为 .tiff 图像?
基础教程推荐
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01