10.31控件练习题

2016-11-01  本文已影响0人  冰凡513

importUIKit

classViewController:UIViewController{

//使用UIVicw搭建界面

overridefuncviewDidLoad() {

super.viewDidLoad()

//frame:CGRectMake(x,y,,width,height),表示该控件在父视图中的坐标

letview0 =UIView(frame:CGRectMake(30,60,80,40))

//UIColorios里面表示的颜色

view0.backgroundColor=UIColor.cyanColor()

//添加控件

view.addSubview(view0)

}

overridefuncdidReceiveMemoryWarning() {

super.didReceiveMemoryWarning()

}

}

上一篇 下一篇

猜你喜欢

热点阅读