我有一个带有一个区段标题的表视图。使用以下代码片段,当用户向左或向右滑动视图时,我重新加载表视图。
[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView endUpdates];当用户在表视图中向下滚动然后滑动时,此代码片段会正确地重新加载行,但sectionheader将在启动滑动的行上创建。
谁能告诉我我哪里做错了&怎么解决?
谢谢,弗兰克
发布于 2011-09-26 18:17:02
我认为问题是reloadSections:withRowAnimation似乎在iOS 4.0上有错误,并且在后来的一个版本中得到了修复。
在iOS 4.0上,调用reloadSections:withRowAnimation会导致表头出现在行的中间,而在4.3上,它工作得很好。我已经用reloadData替换了它,它不是最优的,但也可以在4.0上工作。
https://stackoverflow.com/questions/5117426
复制相似问题