所以,艺术家给我发了一个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中
发布评论