📜  更改选择颜色 uitableviewcell swift 代码示例

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

代码示例1
override func setSelected(_ selected: Bool, animated: Bool) {
     super.setSelected(selected, animated: animated)

     if selected {
         contentView.backgroundColor = UIColor.green
     } else {
         contentView.backgroundColor = UIColor.blue
     }
 }