直接上方法:
- (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
注意事项:这个方法的调用者只能是 taleView对象,假如用Cell对象或其它对象调用则会报错!
若想延迟n秒后让Cell 的选中状态 ,则可以配合 :
performSelector:@selector(deselectRowAtIndexPath:animated:)withObject:indexPath afterDelay:n]
来实现。
还有一种方法是 Cell 的方法:
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
这两种方法的区别:
上面那个是tableView的调用方法: 这个种方法是去掉该行cell的选中状态;
下面这个是Cell 的调用方法: 只是单纯的改变了Cell的Style,改掉后依旧是选中状态