使用 didSelectRowAtIndexPath 完成某些操作后如何取消选择 UITableViewCell? [英] How to unselect a UITableViewCell after you have done some action using didSelectRowAtIndexPath?

查看:58
本文介绍了使用 didSelectRowAtIndexPath 完成某些操作后如何取消选择 UITableViewCell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在 didSelectRowAtIndexPath 委托中做了一些工作,并注意到在我稍后回到视图控制器后我的行仍然被选中".

Currently I do some work inside the didSelectRowAtIndexPath delegate and noticed that my row is still "selected" after I come back to the view controller later.

如何取消选择委托本身内的这一行?

How can I unselect this row inside the delegate itself?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  //do logic and ... it remains selected in the view?
}

推荐答案

[tableView deselectRowAtIndexPath:indexPath animated:YES];

这篇关于使用 didSelectRowAtIndexPath 完成某些操作后如何取消选择 UITableViewCell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆