LoginSignup
27
26

More than 5 years have passed since last update.

UITableViewCellの高さが常に一定の時はrowHeightを使う

Posted at
self.tableView.rowHeight = 44.0f;

みたいに書く。

高さ可変のケースが多いから、他からコピペしてきて

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  return 44.0f;
}

とか書いてしまうけど、これは無駄。

セルが100個あったら、100回heightForRowAtIndexPath呼ばれるから。

27
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
26