📌  相关文章
📜  如何在 ios 中以编程方式创建按钮操作 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:00.494000             🧑  作者: Mango

代码示例1
let button   = UIButton(type: UIButtonType.System) as UIButton
button.frame = CGRectMake(100, 100, 100, 50)
button.backgroundColor = UIColor.greenColor()
button.setTitle("Test Button", forState: UIControlState.Normal)
self.view.addSubview(button)