【swift系列之UIButton】简单使用

来源:互联网 发布:powerdesigner ubuntu 编辑:程序博客网 时间:2024/05/17 01:22
override func viewDidLoad() {        super.viewDidLoad()        let button = UIButton.buttonWithType(UIButtonType.System) as! UIButton        button.frame = CGRectMake(100, 100, 80, 50)        button.backgroundColor = UIColor.orangeColor()        button.setTitle("选照片", forState: UIControlState.Normal)        button.addTarget(self, action: "clickBtn:", forControlEvents: UIControlEvents.TouchUpInside)        self.view.addSubview(button)    }    func clickBtn(sender:UIButton){        self.fromAlbum()    }

0 0
原创粉丝点击