答案 0 :(得分:0)
以这种方式创建按钮:
let button = UIButton(type: UIButtonType.system)
button.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
button.setTitleColor(UIColor.black, for: UIControlState.normal)
button.backgroundColor = UIColor.white
button.layer.cornerRadius = 4