我正在尝试UIButton
使用属性检查器“状态配置”来配置禁用状态。如何为禁用状态配置背景颜色?
试试这个:
@IBAction func buttonStateChanged(sender: UIButton) {
if(sender.selected){
sender.backgroundColor = UIColor(red: 1.0, green: 0.0, blue: 0.2, alpha: 1.0)
}else{
sender.backgroundColor = UIColor(red: 1.0, green: 0.0, blue: 0.2, alpha: 1.0)
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句