文字(图像和颜色)在 Xcode 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46885966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Literals (Images & Colors) don't work in Xcode
提问by Badr
When I try using literals in a Playground, it shows me like this (doesn't show my image):
当我尝试在 Playground 中使用文字时,它显示我这样(不显示我的图像):
in above i add image or UIImage literal but doesn't show their contents.\
在上面我添加了图像或 UIImage 文字但不显示它们的内容。\
and also this with colors (I can't even see colors):
还有这个颜色(我什至看不到颜色):
回答by PGDev
回答by Badr
Make sure you add to the class import UIKit
确保您添加到班级 import UIKit