资产目录未在项目中使用 [英] Asset Catalog not being used in project

查看:123
本文介绍了资产目录未在项目中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a project using an asset catalog and recently without any change on my part, the images are just not displaying. It displays this error:

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"

我知道这已在这里得到解答:
资产目录错误:CUICatalog:找不到名称的再现,但解决方案是使用Cocoapods,但我根本不在我的项目中使用Cocoapods,我甚至没有在我的Mac上安装它。

I know this has already been answered here: Asset Catalog Error: CUICatalog: Can't find rendition for name but the solution to that was with Cocoapods, but I don't use Cocoapods on my project at all and I don't even have it installed on my Mac.

推荐答案

我过去曾经遇到过这种情况,而且一直是因为我将图像集设置为设备特定而不是通用时使用iPhone和iPad的图像。

I've had this happen to me in the past, and it's always been because I have the Image Set set to "Device Specific" instead of "Universal" when using an image for iPhone and iPad.

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

For example, if you're using "~iphone" in the name and dragging into the assets catalog, it'll automatically get set as "Device Specific" with "iPhone" selected. Then when you load on iPad it may grab that image still (since that's Xcode's best guess at what you want), but give a warning saying it couldn't find an iPad one. Switching the image set to universal fixes the issue.

我愿意打赌你有完全相同的问题,但你用~ipad做到了。

I'm willing to bet you have the exact same issue, but you did it with "~ipad".

这篇关于资产目录未在项目中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆