Asset Catalog not being used in project

扶醉桌前 提交于 2019-12-05 17:54:15

问题


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"

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.


回答1:


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.

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.

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



来源:https://stackoverflow.com/questions/24375863/asset-catalog-not-being-used-in-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!