而不是默认的selectionStyle在哪里背景视图改变颜色我试图只改变我已经添加到guideViewCell
UIView的颜色。但是,取消选中单元格或按另一个单元格时,它似乎不会将clearColor应用于之前的indicatorImage。我试图将selectedBackgroundView设置为clearColor,但是这会隐藏我的自定义边框。我能做些什么来解决这个问题?didDeSelectRowAtIndexPath没有被调用时selectionStyle没有
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("GuideCell", forIndexPath: indexPath) as! GuideViewCell
cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var cell = tableView.cellForRowAtIndexPath(indexPath) as! GuideViewCell
cell.indicatorImage.backgroundColor = UIColor.blackColor()
}
func tableView(tableView: UITableView, didDeSelectRowAtIndexPath indexPath: NSIndexPath) {
var cell = tableView.cellForRowAtIndexPath(indexPath) as! GuideViewCell
cell.indicatorImage.backgroundColor = UIColor.clearColor()
}
问题'didDeSelectRowAtIndexPath' IR应该是''didDeselectRowAtIndexPath – 0yeoj