I could not find the source. To scroll and hold the scrollview position, here is the code.
To represent where you want to set the scroll and hold, do this.
Viewcontroller.h
@property (weak, non-atomic) IBOutlet UIScrollView * scrollView; // from the interface constructor @property (weak, non-nuclear) IBOutlet UIView * contentView; // from the interface
Finally, the interface hierarchy should be: view → scrollView → contentView → view Contents viewController.m
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews]; [self.scrollView layoutIfNeeded]; self.scrollView.contentSize = self.contentView.bounds.size;
}
// Reject scrollView when you press the return key. You can place this code anywhere you want.
}
Check this out for more information. http://spin.atomicobject.com/2014/03/05/uiscrollview-autolayout-ios/ Hope this helps someone ...
source share