3
votes

I encountered this problem when using UITableView, the tableView's cells have different heights, and the auto layout constraints are set properly. When you scroll down to the bottom of tableView and load more data (no matter by using reloadData or insertRowsAtIndexPaths), and then scroll up, the tableView will start to be jumpy at some point, and then be jumpy all the time until you scroll to the very top.

Not only for my own project, I find this project on github (link) have the same problem so that you can reproduce it.

1
can you give us link of that github project to check out what you are saying ? .saket kumar
@saketkumar Thanks for your inform, the link is addedwaterlee23
Hello, do you have solution on this issue so far? I have the exact same problem with iOS 8 autolayout.Ken Hui
@KenHui, I calculate each cell's height "manually" to solve the problem (by implementing heightForRowAtIndexPath method)waterlee23
@waterlee23 That's so frustrating. I took care to set up the autolayout and the result was a jumpy tableview and me having to do height calculations manually.TylerJames

1 Answers

1
votes

Did you solve the problem? I finally solved this issue, the key is to calculate an estimated height. Seems like the more accurate estimate you return, the less jumpiness/choppiness.

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
 switch (yourTypeOfCell) {
     case something:
        return estimatedHeight;
        break;
     case default:
        return defaultValue;
        break;
 }
}