I am using view inside a scroll view using autolayout , I have set the scrollview constraint as top,bottom,leading and trailing. View inside the scroll view is also set up with same constaint top,bottom,leading and trailing with scrollview. But the view shifts down at runtime.
I am attaching the screen shots.
Try to add in the
viewDidLoad()
method:Take a look at this answer for a complete and detailed explanation about
automaticallyAdjustsScrollViewInsets
and other relatedUIScrollView
flags: https://stackoverflow.com/a/19585104/1392452