estimatedHeightForRowAtIndexPath 和 heightForRowAtIndexPath 之间的区别?
Difference between estimatedHeightForRowAtIndexPath and heightForRowAtIndexPath?
你好谁能帮我知道以下两种方法的区别。
第一个:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
第二个:
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
提前致谢。
heightForRowAtIndexPath
是真实身高。单元格高度为 100.
estimatedHeightForRowAtIndexPath
不是真实身高。 Cell预估高度为100,实际高度再根据约束
计算
你好谁能帮我知道以下两种方法的区别。
第一个:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
第二个:
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
提前致谢。
heightForRowAtIndexPath
是真实身高。单元格高度为 100.
estimatedHeightForRowAtIndexPath
不是真实身高。 Cell预估高度为100,实际高度再根据约束