Вместо стандартного выбораStyle, где фоновый вид меняет цвет. Я пытаюсь просто изменить цвет UIView, который я добавил в guideViewCell
. Однако при отмене выбора ячейки или нажатии другой ячейки она, похоже, не применяет clearColor на предыдущем индикаторе. Я попытался установить selectedBackgroundView на clearColor, но это скроет мою пользовательскую границу. Что я могу сделать, чтобы решить эту проблему?didDeSelectRowAtIndexPath не вызывается при выбореStyle none
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' л должен быть' 'didDeselectRowAtIndexPath – 0yeoj