【问题标题】:Asset Catalog not being used in project项目中未使用资产目录
【发布时间】:2014-08-14 01:55:09
【问题描述】:

我有一个使用资产目录的项目,最近我没有进行任何更改,只是没有显示图像。它显示此错误:

2014-06-23 21:41:02.824 Project[8247:464100] CUICatalog: Can't find rendition for name: menu scale factor: 2 device idiom: 1 device subtype: 568
2014-06-23 21:41:02.825 Project[8247:464100] Could not load the "image" image referenced from a nib in the bundle with identifier "com.sieradzki.Project"

我知道这里已经回答了这个问题: Asset Catalog Error: CUICatalog: Can't find rendition for name 但解决方案是使用 Cocoapods,但我根本不在我的项目中使用 Cocoapods,我什至没有在我的 Mac 上安装它。

【问题讨论】:

  • my answer here ...我也没有使用Cocoapods。
  • 您是否检查过您的 nib 文件中,UIImageView 的图像未显示为unknown?图像会在 Interface Builder 中正确呈现。
  • 您是否有可能将目录中的资产设置为使用特定于设备的资产,但没有为 4 英寸 iPhone 设置特定资产(Retina + 568 是什么意思)?
  • 这听起来很傻,但昨天发生在我身上:你检查过目标标志是否检查了资产目录吗?

标签: ios objective-c ios7 asset-catalog


【解决方案1】:

我过去也遇到过这种情况,一直是因为我在为 iPhone 和 iPad 使用图像时将图像集设置为“特定于设备”而不是“通用”。

例如,如果您在名称中使用“~iphone”并将其拖入资产目录,它会自动设置为“特定于设备”并选择“iPhone”。然后,当您在 iPad 上加载时,它可能仍会抓取该图像(因为这是 Xcode 对您想要的最佳猜测),但会发出警告说它找不到 iPad 图像。将图像集切换为通用可解决此问题。

我敢打赌你也有同样的问题,但你是用“~ipad”解决的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-16
    • 2019-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-16
    • 1970-01-01
    相关资源
    最近更新 更多