title: What changes contentOffset when a UIScrollView with contentInset changes its frame from an autoresize?
body: <p>I have an issue where a scroll view will behave as expected on an iPhone 5 screen (320 points wide) but will have a negative horizontal <code>contentOffset</code> when it's autoresized by its super view to fit an iPhone 6 screen (375 points wide). The reason the offset can be negative is because the view also has a <code>contentInset</code> to the left. But since it was 0 before the automatic resize, I would expect it to still be 0 after.</p>
  
  <p>I am setting up a <code>UIScrollView</code> inside the <code>initWithStyle:reuseIdentifier:</code> method of a <code>UITableViewCell</code> subclass like this:</p>
  
  <pre><code>UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.contentView.bounds];
  scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  scrollView.contentSize = self.contentView.bounds.size;
  scrollView.contentInset = UIEdgeInsetsMake(0, 100, 0, 0);
  [self.contentView addSubview:scrollView];
  </code></pre>
  
  <p>I can confirm that the <code>contentOffset</code> is (0, 0) at this point (presumably because everything gets autoresized to fit the iPhone 6 screen at a later point in time). I tried probing the value in various methods. In <code>setFrame</code> it's (0, 0) but in the first call to <code>layoutSubviews</code> it's (-55, 0) – presumably because the difference between iPhone 6 and iPhone 5 horizontal display points is 375 - 320 = 55.</p>
  
  <p>Here's a screenshot of what happens on an iPhone 6 screen (in this screenshot I have put additional views inside the scroll view so that it can be seen graphically):
  <img src="https://i.stack.imgur.com/lstGf.png" alt=""></p>