图像未显示在Interface Builder / iPhone中的UIImageView中 [英] Image not showing in UIImageView in Interface Builder / iPhone

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

问题描述

我有 UIView ,并将 UIImageView 拖到视图上。突然之间,对于我的所有xib,图像不再显示。有一个蓝色X.但是,当它构建时,图像就在那里。

I have a UIView with an UIImageView dragged onto the view. All of a sudden, for all my xibs, the image no longer shows up. There is a blue X. However, when it builds, the image is there.

有一次,我删除并重新生成了所有图像,并将一些图像移入了一个子文件夹中Xcode中。通常,当您为 UIImageView 选择图像时,IB允许您从项目中的任何图像中进行选择。但是,我无法在下拉列表中看到我放在文件夹中的任何图像。

At one point, I deleted and regenerated all my images and moved some into a subfolder in Xcode. Normally, when you go to select an image for an UIImageView, IB allows you to pick from any image in the project. But, I can't see any of the images I had put in the folder anymore in the dropdown.

我在Inspector下拉列表中看到的只是我想要的一个图像,但这也是未显示的图像。就像我说的,如果我在设备或模拟器上构建它,它一切正常。

All I see in the dropdown on the Inspector is the one image I want, but that is also the one that is not showing up. And like I said, if I build it on the device or simulator, it all works.

有一些缓存或某些东西搞砸了。一切都没有错误。我清除了缓存并重建了。一切正常。没有错误或警告。但是......我看不到任何其他图像,IB仍然认为它丢失了在下拉列表中明确选择的图像。

There is some cache or something screwed up somewhere. Everything builds with no errors. I cleared the caches and rebuilt. It all works. No error or warnings. But...I can't see any other images and IB still thinks it's missing the image that is clearly selected in the dropdown.

那么如何获得Xcode和IB回到正轨,看看它在XIB中应该看到哪些资产?

So how do I get Xcode and IB back on track and see what assets it properly should be seeing in the XIBs?

推荐答案

尝试清理和重建项目。

如果它仍然不起作用,则从Xcode中删除所有图像(仅选择删除参考),然后通过将这些图像拖动到Xcode中再次重新添加它们。然后重新构建它,它应该工作。

If it's still not working then remove all images from Xcode (select delete reference only) and then re-add them again by dragging those images into Xcode. Then re-build it and it should work.

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

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