……

ios手写按钮基本步骤


示例代码:

// 按钮基本理解

//CG:计算机图形
let rect = CGRect(x: 0, y: 0, width: 300, height: 100)
let rectButton = UILabel(frame: rect)
rectButton.text = "立即订购"
rectButton.textColor = UIColor.white
rectButton.backgroundColor = UIColor.systemPink
//Alignment校准
rectButton.textAlignment = .center
//layer是层,corner角,radius半径
rectButton.layer.cornerRadius = 20
//clipsToBounds 是否裁边
rectButton.clipsToBounds = true```

posted on 2020-10-26 17:30  Exlo  阅读(84)  评论(0编辑  收藏  举报

导航