迁移到资产目录后,情节提要板不显示资产 [英] Storyboard doesn't display assets after migrating to Asset Catalog

查看:90
本文介绍了迁移到资产目录后,情节提要板不显示资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将图像资源迁移到资产目录后,该应用程序会构建并正确运行,但资产不会显示在Xcode的故事板上.

After migrating image resources to an Asset Catalog the app builds and runs correctly but the assets don't show up in Xcode's storyboard.

推荐答案

在我的情况下,这是因为我在Storyboard中使用了完整的资产名称,包括文件扩展名(即".png").

In my case this occurred because I used the full asset name including file extension (i.e. '.png') in Storyboard.

但是,资产名称必须与资产目录中的图像集名称相匹配:

However, the name for the asset needs to match the name of the Image Set in the Asset Catalog:

因此,通过从情节提要中的图像名称中删除".png",就解决了该问题.

So by removing '.png' from the image name in Storyboard it solved the problem.

这篇关于迁移到资产目录后,情节提要板不显示资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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