ios - UITableViewCell setSelected :animated having no effect when animated

标签 ios ipad uitableview

我在 iPad 上有一个 View Controller ,上面有三个 UITableView。他们都有dataSourcedelegate设置为 VC。在 tableView:didSelectRowAtIndexPath:在 VC 中,我这样做:

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSLog(@"Cell: %@", cell);
[cell setSelected:NO animated:YES];

它记录正确的单元格(非零),但该单元格始终保持选中状态,直到选择同一表中的另一个单元格。如果我通过 NO对于 animated ,它工作正常。这是怎么回事?为什么单元格不会对其取消选择进行动画处理?

最佳答案

您可以使用 [tableView deselectRowAtIndexPath:indexPath animated:YES];获得您正在寻找的功能。

关于ios - UITableViewCell setSelected :animated having no effect when animated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10231590/

相关文章:

ios - 如何在 CoreData iOS 谓词生成器中多次传递相同的参数?

ios - UIView 隐藏/显示动画

iphone - iOS 通知到达时推送特定 View

ios - 只为 iPad 设置横向方向而不是 iPhone

ios - 如何在不通过 segue 实例化的情况下预加载或缓存目标 View Controller

ios - 在 UITableView 中实现 Accordion 的最佳方式

ios - 如何使用 Swift (Xcode) 将数组添加到 firebase

ipad - 可以在不重新加载表格 View 的情况下更改 UITableViewCell 的高度吗?

iphone - 带有UITableView的UIViewController崩溃

arrays - 快速从 TableView 列表中删除多个项目