Place the two labels in the UIView container. Limit the edges of the labels to the edges of the container (except for the bottom of the top label and the top of the bottom label, which should be bounded by each other), and then vertically center the container at its top level.
:
UIView rootView
UIView containerView
UILabel topLabel
UILabel bottomLabel
:
|[topLabel]|
|[bottomLabel]|
V:|[topLabel][bottomLabel]|
|-[containerView]-|
[NSLayoutConstraint constraintWithFirstItem:containerView firstAttribute:NSLayoutConstraintAttributeCenterY relation:NSLayoutRelationEquals secondItem:rootView secondAttribute:NSLayoutConstraintAttributeCenterY multiplier:1 constant:0]
( IB, , IB StackOverflow.)
. iOS , , .