相关疑难解决方法(0)

iOS Playground不显示UI预览

我用XCode 7.1创建了一个简单的游乐场,我输入了这个简单的代码:

import UIKit 
import XCPlayground 

var str = "Hello, playground" 

let color = UIColor (red: 1 , green: 1 , blue: 0 , alpha: 0 ) 

let view = UIView() 
view.backgroundColor = UIColo (colorLiteralRed: 1 , green: 0 , blue: 0 , alpha: 0 ) 

view.frame = CGRect (x: 0 ,y: 0 ,width: 100 ,height: 100 ) 

let label = UILabel (frame: CGRect (x: 5 , y: 5 , width: 50 , height: 20 )) 

label.text = str 

view.addSubview(label) …
Run Code Online (Sandbox Code Playgroud)

xcode uikit ios swift swift-playground

56
推荐指数
4
解决办法
4万
查看次数

标签 统计

ios ×1

swift ×1

swift-playground ×1

uikit ×1

xcode ×1