美文网首页OC开发资料收集区
TableView如何刷新指定的cell 或section和滚

TableView如何刷新指定的cell 或section和滚

作者: 蜗牛锅 | 来源:发表于2017-06-05 22:41 被阅读25次

//一个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];

相关文章

网友评论

    本文标题: TableView如何刷新指定的cell 或section和滚

    本文链接:https://www.haomeiwen.com/subject/ecbwfxtx.html