局部刷新UITableView

刷新局部cell

NSIndexPath*indexPath = [NSIndexPathindexPathForRow:0inSection:0]; [self.tableView reloadRowsAtIndexPaths:[NSArrayarrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationFade]; 

刷新局部section

NSIndexSet*indexSet = [[NSIndexSetalloc] initWithIndex:0]; [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade];

关于刷新动画

刷新动画还有其他几个动画可以使用

typedefNS_ENUM(NSInteger, UITableViewRowAnimation) {UITableViewRowAnimationFade, //淡入淡出UITableViewRowAnimationRight, //从右滑入 UITableViewRowAnimationLeft, //从左滑入UITableViewRowAnimationTop, //从上滑入UITableViewRowAnimationBottom, //从下滑入UITableViewRowAnimationNone, // available in iOS 3.0UITableViewRowAnimationMiddle, // available in iOS 3.2. attempts to keep cell centered in the space it will/did occupyUITableViewRowAnimationAutomatic= 100// available in iOS 5.0. chooses an appropriate animation style for you};



 

猜你喜欢

转载自blog.csdn.net/a18339063397/article/details/83860074