I've implemented 'infinite scrolling' on one of my projects and I was playing around with the new estimatedHeightForRowAtIndexPath: delegate method. Once I implemented that delegate method, my tableView jumps (a.k.a scroll to the bottom) whenever i call reloadData (which happens when i add a new set of rows.)
Without that method, my tableView stays in place and it adds the additional rows to the bottom of the tableView without any scrolling.
I'm calling the [tableView reloadData] and not the other methods (insertRowsAtIndexPaths:). I don't call the beginUpdates or endUpdates since I'm reloading the whole table.
Has anyone experienced this ? I
So here's what i did to reduce the jumping while reloading the tableView.
In the estimatedHeightForRowAtIndexPath: I started returning a better estimated height. The more accurate the height is, lesser the jumping while adding new rows to the bottom.
I also started caching the calculated height of the cell from heightForRowAtIndexPath: in a dictionary and return the cached value the next time it calls the estimatedHeightForRowAtIndexPath:.
Hope this helps anyone who encounters this issue.
I filed a BugReport quite a while ago (16472265) and today got the response that it's fixed in iOS8. Tried it out and it works now as expected. No more jumping of the tableview! Wohoooo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With