示例代码:
// 按钮基本理解
//CG:计算机图形
let rect = CGRect(x: 0, y: 0, 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```