//一个section刷新
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
//一个cell刷新
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
// 滚动到制定位置
[self.matchListTableView reloadData];
NSIndexPath * dayOne = [NSIndexPath indexPathForRow:0 inSection:2];
[self.matchListTableView scrollToRowAtIndexPath:dayOne atScrollPosition:UITableViewScrollPositionTop animated:YES];
本文介绍了如何在iOS开发中使用UITableView刷新指定的cell或section,以及如何滚动到特定的位置。通过NSIndexSet和NSIndexPath对象,可以实现单个section或cell的刷新,并使用scrollToRowAtIndexPath方法轻松滚动到所需位置。
449

被折叠的 条评论
为什么被折叠?



