swift - 文字(图像和颜色)在 Xcode 中不起作用

标签 swift xcode

当我尝试在 Playground 中使用文字时,它显示如下(不显示我的图像):

anotherExample 在上面我添加图像或 UIImage 文字但不显示它们的内容。\

还有颜色(我什至看不到颜色):

another example

最佳答案

键入 #colorLiteral()#imageLiteral() 以分别查看颜色选择器或图像选择器。

color literal or image literal in xcode placeholder

注意:图像选择器将在 Assets.xcassets 中列出您的图像。

关于swift - 文字(图像和颜色)在 Xcode 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46885966/

相关文章:

xcode - 如何添加常数 "drop"速度而不是重力

iphone - PhoneGap openDatabase() 方法在 iPhone/iPad 4.x 应用程序中返回 null

objective-c - 什么是任意对象?

xcode - 自动布局粘在错误的一边

iOS Libcurl 代理 C++

xcode - SQlite数据库SELECT EXC_BAD_INSTRUCTION代码EXC_I386_INVOP子代码0x0

ios - SwiftUI 跨多个 subview 拖动手势

swift - 使用数组存储的颜色(字符串)来设置标签元素的 UIColor

ios - 使用 Stripe SDK 处理信用卡

ios - 什么是Swift预处理器相当于iOS版本检查比较?