Setting Dynamic Constraints on Scrollview in iOS | TechNet
For any iOS developer, Autolayout is a very useful feature which is used in designing the iPhone / iPad App UI. Among all the controls that AutoLayout provides, UIScrollView is one of the most useful controls in iOS as it enables iOS app developer to present the content larger than a single screen. The view is scrollable when the content length is larger than the screen size. Unlike other controls, the scrollview needs all the constraints for its edges i.e. for edges (top, left, bottom, right) and the controllers that are added in the scrollview must be given the constraints w.r.t the edges of scrollview because scrollview calculates it's content from the constraints given to controllers. When you are giving the constraints to the scrollview then its not required to set its contentSize because it is automatically calculated from the given constraints to its subview. You can set scrollview's offset to move scrollview up and down as required. You must turn off autoresizing property.