首页 > 其他 > 详细

tatableView 刷新

时间:2015-08-20 12:46:15      阅读:414      评论:0      收藏:0      [点我收藏+]

1.一般情况下,刷新tableView,我们会直接调用reloadData方法   

    [self.tableView reloadData];

 但是有的时候我们需要刷新指定的cell和section,这个时候在调用reloadData的话,就浪费资源了。

2.刷新局部的cell

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

 [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationFade];

 

3.刷新局部的section

NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:0];

 [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade];

 

4.刷新动画

typedef NS_ENUM(NSInteger, UITableViewRowAnimation) {

    UITableViewRowAnimationFade,

    UITableViewRowAnimationRight,           

    UITableViewRowAnimationLeft,

    UITableViewRowAnimationTop,

    UITableViewRowAnimationBottom,

    UITableViewRowAnimationNone,            

    UITableViewRowAnimationMiddle,          

    UITableViewRowAnimationAutomatic = 100  

};

 

tatableView 刷新

原文:http://www.cnblogs.com/fantasy3588/p/4744533.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!