Monday, May 30, 2022

StackView - Constraining Contained Views

 These are the steps to layout a StackView's contained views by constraining the height of the contained views.


Step 1: Add Vertical Stack View


Step 2: Constrain the Stack View


Step 3: Add UIView to the Stack View


Step 4: Duplicate the UIView so that there are three UIViews


Step 5: Set the background color of each UIView to a unique color.


Step 6: Constrain the top UIView to the bottom UIView in the stack. Set to "Equal Heights"


Step 7: Constrain the middle UIView to the bottom UIView in the stack. Set to "Equal Heights"


Step 8: Change the middle UIView's constraint multiplier to 1.0



Step 9: Change the top UIView's constraint multiplier to 0.5

No comments: