iOS UITableViewAutomaticDimension RowHeight Poor Performance / Jumping

别等时光非礼了梦想. 提交于 2019-12-05 07:30:41

I have found weird issue using the line self.tableView.rowHeight = UITableViewAutomaticDimension;

But then, everything came a lot better when I replaced it with the delegates method. In your case would be :

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

- (CGFloat) tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 300.0f;
}

ADD one more delegate method to the code

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{ return Approxheight;}

it will load uitableView early than current time. i hope this will work for you.

In cellForRowAtIndexPath add below line

cell.textLabel.numberOfLines = 0;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!