在新的Xcode 9中添加项目中的图像 [英] Add images in project in new Xcode 9

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

问题描述

在新的Xcode 9中,我想在项目中添加图像。但是,如果我添加图像并尝试在代码或故事板中使用它,我的图像不会显示在模拟器中。但在Xcode 8中一切正常。怎么解决?

In new Xcode 9 I want to add images in project. But If I add images and try to use it in code or in storyboard my images not showing in simulator. But in Xcode 8 all works fine. How to fix it?

推荐答案

注意:此问题在较新的XCode中不再存在

如果您在项目中拖动了图片,则必须选择需要时复制将任何文件添加到项目中。

If you have dragged image in your project, you must select Copy If Needed While adding any file into your project.

添加图片后,如果目标可用,请查看您的图片,我的脸部相似其他文件类型也有问题。
在xcode9中,即使在需要时选择复制,也没有默认选择。

After Adding Image take a look at your image if it is available to target, I have face similar issue with other file types too. In xcode9 it was not selected by default even after selecting copy if needed.

这篇关于在新的Xcode 9中添加项目中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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