I'm trying to understand well Xcode's autolayout constraints, but I immediately encountered an error with UIScrollView constraints. I set up a UIScrollView with 4 constraints: each with value 0 to its parent. Next I set up an UIView as content holder with the same constraints of the UIScrollView, but I receive the following error:
ScrollView: Need constraints for: X position or width
ScrollView: Need constraints for: Y position or height
I already set up this constraints for the scrollview ( 0,0,0,0 to its parent).
Why Xcode tell me this? Thanks in advance.
Update
Fixed setting View.centerX = ScrollView.centerX
and View.centerY = ScrollView.centerY
. But why those constraints are necessary?