2

The title says it all.

If you open the template "Master-Detail" project in Xcode, and test going from the master VC to the detail VC, you will see that upon returning to the master VC, you will come back to the same underlying scrollview offset you left from.

This template project is running iOS8 and with Autolayout enabled (yet not really used).

My project has a similar setup but has a custom cell with many constraints and is also using UIAutomaticDimension to autosize the cells. So in my viewDidLoad, I have:

//Dynamic cell sizing
self.tableView.estimatedRowHeight = 350.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;

And now, my contentOffset property of UIScrollView still calculates correctly (checked using Breakpoints) but does not seem to do anything when I do this for example:

self.tableView.contentOffset =  CGPointMake(self.tableView.contentOffset.x, self.myNewContentOffset.y);

Is there any conflict between UITableViewAutomaticDimension and the setting UIScrollView contentOffset?

Thanks

Khaled Barazi
  • 8,681
  • 6
  • 42
  • 62

0 Answers0