优化11条
1.避免 cellForRowAtIndexPath 中使用 addsubview 加载众多view 会引起严重卡顿
2.自定义UITableViewCell 时一般这样处理
static NSString *ID = @"HomeActivityCell3";
HomeActivityCell3 *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed:ID owner:nil options:nil] objectAtIndex:0];
}
Identifier未标识,cell不会被重用
3.尽量使所有的view opaque,包括cell自身
4.避免渐变,图片缩放,后台选人
5.缓存行高
6.如果cell内显示的内容来自web,使用异步加载,缓存请求结果
7.使用shadowPath来画阴影
9.使用正确的数据结构来存储数据
10使用rowHeight, sectionFooterHeight和 sectionHeaderHeight来设定固定的高,不要请求delegate
11.数据刷新使用reloadDataInPath,不要使用reloadDataForCellIndexPatch
12使用太多imageview.layer.cornerRadius图片切成圆形 耗性能,应该使用贝塞尔曲线绘制