importUIKit
classViewController:UIViewController{
//使用UIVicw搭建界面
overridefuncviewDidLoad() {
super.viewDidLoad()
//frame:CGRectMake(x,y,,width,height),表示该控件在父视图中的坐标
letview0 =UIView(frame:CGRectMake(30,60,80,40))
//UIColor是ios里面表示的颜色
view0.backgroundColor=UIColor.cyanColor()
//添加控件
view.addSubview(view0)
}
overridefuncdidReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
网友评论