您的位置:首页 > 产品设计 > UI/UE

[iOS]UITableView刷新

2015-09-24 15:57 435 查看
刷新整个tableView

[self.tableView reloadData];


刷新局部cell

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationFade];


局部刷新section

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


刷新动画

typedef NS_ENUM(NSInteger, UITableViewRowAnimation) {
UITableViewRowAnimationFade,   //淡入淡出
UITableViewRowAnimationRight,  //从右滑入         // slide in from right (or out to right)
UITableViewRowAnimationLeft,   //从左滑入
UITableViewRowAnimationTop,     //从上滑入
UITableViewRowAnimationBottom,  //从下滑入
UITableViewRowAnimationNone,            // available in iOS 3.0
UITableViewRowAnimationMiddle,          // available in iOS 3.2.  attempts to keep cell centered in the space it will/did occupy
UITableViewRowAnimationAutomatic = 100  // available in iOS 5.0.  chooses an appropriate animation style for you
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: