单击时我正在更改单元格颜色,并且还在更改单元格底部的小自定义分隔符。但是,当我拨打deselectRowAtIndexPath
时,分隔符颜色会恢复到忽略我的更改之前的颜色。为什么会发生这种情况,我该如何完成这个简单的任务? 这里是我的代码:在UITableView中选择后,无法更改分隔符(自定义UIView)颜色
[tableView deselectRowAtIndexPath:indexPath animated:NO];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
UIView *separator = [cell viewWithTag:SEPARATOR];
separator.backgroundColor = _colorOrangeSelected;