【发布时间】:2018-04-04 21:01:00
【问题描述】:
我在 UITableViewCell 中添加了一个自定义标签。它的背景颜色为红色,字体为白色。当我选择任何单元格时,所选单元格的标签背景颜色变为灰色。
供参考,我正在添加代码
let lblUnreadCount = cell?.viewWithTag(3) as! UILabel
let size:CGFloat = 20.0
lblUnreadCount.bounds = CGRect(x: 0.0, y: 0.0, width: 28.0, height: 20.0)
lblUnreadCount.layer.cornerRadius = size / 2
lblUnreadCount.layer.borderWidth = 1.0
lblUnreadCount.layer.backgroundColor = UIColor.red.cgColor
lblUnreadCount.layer.borderColor = UIColor.red.cgColor
【问题讨论】:
-
将选择设置为无
标签: ios iphone uitableview swift3 uilabel