Search code examples
iosautolayoutinterface-builder

Center UIView vertically without relating it to its superview centerY


I have a UIView in a portrait-only app. The view is centered vertically and horizontally with AutoLayout ("manually" using storyboards).

From the XCode IDE, is there any way to express the SAME vertical relation using the Top instead of the Superview.centerY? Can I perfectly center my view vertically another way?

This is the current situation:

enter image description here


Solution

  • If you want to express the SAME vertical relation using the Top instead of the Superview.centerY, change multiplier to 0.5

    enter image description here