我有一个UITableView,UISegmentedControl标题视图中有一个.它应该像在App Store应用程序中一样工作:当用户滚动时,标题中的标题会滚动屏幕,但是在标题segmentedControl下方navigationBar.

当用户选择一个段时,标题下面的部分应该重新加载一个好的UITableViewRowAnimation.但是,正如我所说tableView:reloadSections:withRowAnimation:,标题视图也是动画的,我想阻止它,因为它看起来很糟糕.
这是我的代码:
- (void)selectedSegmentIndexChanged:(UISegmentedControl *)sender
{
int index = sender.selectedSegmentIndex;
if (index < self.oldIndex) {
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationLeft];
} else if (index > self.oldIndex) {
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationRight];
}
self.oldIndex = index;
}
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何重新加载标题下方的部分而不重新加载标题本身?
在对tableview数据进行某种排序后,我需要重新加载不包括标题的部分.这就是说我只想重新加载该部分中的所有行.但是在我搜索一段时间后,我找不到一个简单的方法.
reloadSections(sectionIndex, with: .none) 这里不起作用,因为它会重新加载整个部分,包括页眉,页脚和所有行.
所以我需要reloadRows(at: [IndexPath], with: UITableViewRowAnimation)改用.但是如何获取该部分中所有行的整个indexPath.