您的位置:首页 > 其它

TableView如何刷新指定的cell 或section和滚动到制定位置

2015-12-23 11:20 507 查看
//一个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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: