I have a problem with autolayout(maybe) and my scrollview!
My Problem
This isn't great but I beat auto-layout (definitely not the correct way but I was sick of trying!) by setting the content size in viewDidAppear after autolayout happens, setting the scrollOffset and persisting the scroll offset in viewDidDisappear, and then setting the scroll offset back to it's persisted state in viewDidAppear.
Like this:
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:YES];
self.scrollView.contentSize = self.scrollViewInnerView.frame.size;
self.scrollView.contentOffset = [self.scrollOffsetToPersist CGPointValue];
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:YES];
self.scrollOffsetToPersist = [NSValue valueWithCGPoint:self.scrollView.contentOffset];
self.scrollView.contentOffset = CGPointZero;
}
Not at all elegant, but works so thought I'd share.