ios tableview 那些事(二十二) 使cell高度可变的tableview加载速度更快

ios 7 更新后,我对tableview新更新的 方法也有些了解,但是没有具体测试这个新方法


// Use the estimatedHeight methods to quickly calcuate guessed values which will allow for fast load times of the table.

// If these methods are implemented, the above -tableView:heightForXXX calls will be deferred until views are ready to be displayed, so more expensive logic can be placed there.


// 对可变cell 高度的估算。

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPathNS_AVAILABLE_IOS(7_0);

// 对可变tableview headview 高度的估算。

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)sectionNS_AVAILABLE_IOS(7_0);

// 对可变tableview  footerview 高度的估算。

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)sectionNS_AVAILABLE_IOS(7_0);

 

今天看了下国外一个人写的博客,并写了测试demo,让我吃惊的是 加载速度提升了一倍,同时也表现出来苹果开发工程师是有多么的优秀!在可变的cell 工程里面

如果不用新的方法,是不是有点对不起用户,更对起苹果公司哪些高富帅的大神们呢!


废话不多说,下面是那个博客的地址,里面介绍了很多ios7的新方法,并且demo 在githud 里托管了,过果有时间可以了看看!


http://www.shinobicontrols.com/blog/posts/2013/10/16/ios7-day-by-day-day-19-uitableview-row-height-estimation


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值