0

I am using UITableViewAutomaticDimension in estimatedHeightForRowAtIndexPath. My tableViewCells are having large content in it. When i try to reloadData or reloadSection it automatically scroll up or down. I can not use reloadRow as my action can cause insertion/deletion/reload of certain number of rows in section.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Hunter
  • 61
  • 4
  • I am not sure it is related to your issue but `estimatedHeightForRowAtIndexPath` is supposed to return a fixed value. It is `heightForRowAtIndexPath` that should return `UITableViewAutomaticDimension` for supporting self-sizing cells. – Ozgur Vatansever Dec 13 '16 at 07:13
  • Use that "[self.tableView layoutIfNeeded];" after reloading data. – Amanpreet Dec 13 '16 at 07:14
  • You might want to look at this answer if you want to keep the scroll position : http://stackoverflow.com/a/40042923/3548469 – Devang Tandel Dec 13 '16 at 07:15
  • Thank @ozgur it helped me a bit. Now while using `reloadData` it does not scroll automatically but some time for my last section footer view of section hides automatically. My tableView style is `UITableViewStylePlain`. Does it relate to this one? And while reloading section it steel scroll down automatically. – Hunter Dec 13 '16 at 07:51

0 Answers0