When using Auto Layout, I am unable to set up a simple UIScrollView in my view controller in Xcode 11 beta. I know that I must constrain the scroll view to the edges, and th
For me, initially the Content Layout Guides
is in disabled state by default in ScrollView
. So I just enabled and disabled the Content Layout Guides
then the error disappeared automatically.
I stacked with that problem as well. Found a good guide that helped me:
https://useyourloaf.com/blog/scroll-view-layouts-with-interface-builder/
Basically what you need is 9 constraints (assuming you want to scroll only vertically):
1-4: ScrollView to Superview (top, bottom, leading, trailing). Make sure to connect it to parent view and not to safe area.
5-8: Content view to Content Layout guide (top, bottom, leading, trailing).