iOS Dev Nugget 296 Strange UITableView Jumping Behavior when Reloading


Need to run a code review on your codebase? Hire me

Do you use UITableview without self-sizing cells?

I've found an odd behavior that happens when several conditions are met:

  • not use self-sizing cells
  • the number of rows display is such that it the total content height is slightly more than the table view's height
  • you scroll to the bottom of the table

Sometimes when you call reloadData, the table may scroll so there is a gap at the bottom, below the last cell.

Anecdotally, this seems to be fixed by setting UITableview.estimatedRowHeight to 0.

If you experience this, try it out and let me know.

PS: Sorry, I'm late for this issue

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No



Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter


View archives of past issues