XCode 8不在故事板中显示图像 [英] XCode 8 doesn't show images in storyboard

查看:94
本文介绍了XCode 8不在故事板中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新xcode后,故事板中的所有图像都显示为问号(因为它没有找到它们)。我试图删除/添加它们,清除派生数据,但仍然所有图像视图显示问号标记。如果有人知道可能是什么问题?

After updating xcode all images in the storyboard appeared as question marks (as it doesn't find them). I tried to remove/add them, cleared derived data but still all image views show quesiton marks. If anyone has any idea what might be the problem ?

推荐答案

我遇到了同样的问题,我发现这是因为我不喜欢图片的大小与故事板(左下角)中选择的查看为设备相对应。

I had the same problem and I found out that it's because I don't have the image in the size that corresponds to the "View as" device selected in storyboard (bottom left).

如果您选择了需要的设备@ 2x图像(例如:iPhone 6s),你只有@ 3x图像(就像我一样),你会看到问号。如果您为与故事板使用的设备尺寸相对应的图像添加尺寸,图像将显示在您的imageView中。

If you've selected a device that needs the @2x image (example: iPhone 6s) and you only have the @3x image (as I did) you will see the question mark. If you add the size for the image that corresponds to the device size that you are using for storyboard, the image will appear in your imageView.

基本上,您希望拥有所有3种尺寸的图像:@ 1x,@ 2x和@ 3x。

这篇关于XCode 8不在故事板中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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