我在 iPad 上有一个 View Controller ,上面有三个 UITableView。他们都有dataSource
和 delegate
设置为 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/