🤖
UITableViewCellの高さが常に一定の時はrowHeightを使う
self.tableView.rowHeight = 44.0f;
みたいに書く。
高さ可変のケースが多いから、他からコピペしてきて
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44.0f;
}
とか書いてしまうけど、これは無駄。
セルが100個あったら、100回heightForRowAtIndexPath
呼ばれるから。
Discussion