Xcode图像目录:图像未显示在Interface Builder中 [英] Xcode Image Catalogs: Image not showing in Interface Builder

查看:129
本文介绍了Xcode图像目录:图像未显示在Interface Builder中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,艺术家给我发了一个Resources.xcassets文件夹,我只是将其拖入项目中。然后我跳到界面构建器,添加了一个新的UIImageView,从xcassets分配了一个图像名称,令我惊讶的是,我看不到图像。它显示为蓝色问号。

So, the artist sent me a Resources.xcassets folder that I simply dragged into the project. I then jumped to interface builder, added a new UIImageView, assigned an image name from the xcassets, and to my surprise, I couldn't see the images. It shows as a blue question mark.

注意,IB自动完成功能正常,当我运行应用程序时,资产实际显示出来!但不是在界面构建器中,这使得铺设资产几乎不可能,特别是尺寸适合不工作...

Notice, that the IB autocomplete is working, and when I run the application, the assets actually show up! But not in interface builder, which makes laying the assets around virtually impossible, especially with the size to fit not working...

错误报告:15733387

推荐答案

看来我有错...我创建了一个全新的XIB,并确保选择设备系列'iPad',图像现在正常显示。我不认为这是问题,因为您在创建XIB后无法更改设备系列!我到处寻找这些选项,但从未找到它...看到原始的XIB文件,你可以手动进行这种更改,我猜(注意它在哪里说.iPad):

It seems I am at fault... I created a fresh new XIB, and made sure to select device family 'iPad', and the image is now showing up properly. I didn't think that was the problem because you cannot change the device family after creating the XIB! I looked everywhere for that options, but never found it... Seeing the raw XIB files, you can do this change manually, I guess (Notice where it says ".iPad"):

<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4514" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">






是的,我实际解决了它,而且问题是超级疯狂。艺术家将所有资产设置为iPad资源,因此* .imageset文件夹中的Contents.json文件将ipad分配给我拥有的图像。我以崇高的文本打开了json文件,并将ipad更改为universal和BOOM。我在侧面打开Xcode,图像几乎立即出现在IB!比如,... ...


Yeah, I actually solved it, and the problem is super crazy. The artist had set all the assets as "iPad" assets, so the Contents.json file inside the *.imageset folder was assigning the "ipad" to the images I have. I opened the json file in sublime text, and changed the "ipad" to "universal", and BOOM. I had Xcode open on the side, and the image showed up almost instantly in IB!! Like, wth...

这篇关于Xcode图像目录:图像未显示在Interface Builder中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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