[英]Highlight Cell for Multiple selection
I need to change the colour of my cell upon selection to a desired UI Color. 选择后,我需要将单元格的颜色更改为所需的UI颜色。 Below is my code, and it is working fine.
下面是我的代码,它工作正常。 However, why the checkbox area is still in grey colour?
但是,为什么复选框区域仍为灰色? How do I change that?
我该如何改变?
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let selectedCell:UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)!
selectedCell.contentView.backgroundColor = UIColor(red: 43.0/255.0, green: 240.0/255.0, blue: 12.0/255.0, alpha: 1.0)
}
I don't have enough reputations to post images. 我没有足够的声誉来发布图像。 Sorry in advance!
不好意思!
Image 图片
Maybe this is helpfull from my code snippet 也许这对我的代码段很有帮助
var colorVw = UIView()
colorVw.backgroundColor = UIColor.redColor()
cell.selectedBackgroundView = colorVw
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
cell.accessoryView = nil
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.