有关TableView的reload过程分析。
在tableview的区域reload过程中:
[tableview reloadRowsAtIndexPaths:_selectedIndexes withRowAnimation:UITableViewRowAnimationAutomatic];(假设此方法在didsele里面)那么 首先执行的是
[tableview reloadRowsAtIndexPaths:_selectedIndexes withRowAnimation:UITableViewRowAnimationAutomatic];(假设此方法在didsele里面)那么 首先执行的是
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
会将需要显示的cell高度全部遍历一遍
然后 执行
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
会 仅 将需要刷新的cell数据刷新一下
会将需要显示的cell高度全部遍历一遍
然后 执行
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
会 仅 将需要刷新的cell数据刷新一下
然后 会再执行一遍
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
仅 返回刚才cellForRowAtIndexPath里面刷新过的cell。
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
仅 返回刚才cellForRowAtIndexPath里面刷新过的cell。
至此刷新完毕。
评论
发表评论