tableView和collectionView刷新的三種方法

1、刷新一行

    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];

    NSArray *indexArray=[NSArray arrayWithObject:indexPath];

    [addTab reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationNone

];

2.刷新一個分區

NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:indexPath.section];

    [tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone

];

3.刷新整個tableview

[tableView reloadData];

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章