- As usual, let's create a new Xcode project with Single View template and name it StackViews.
- Open the storyboard file and select the view controller and change its size to iPhone 4-inch.
- From Object Library, drag a Vertical stack view and add it as a subview.
- Change its frame to (X = 20, Y = 20, Width = 280).
- We need to add constraints to make the stack view's left, right, and top margins to be equal to 20 and to make its height = 75% of the device screen. To do so, first select the stack view, and click on the Pin button and set the top, left, and right constraint values to 20:
- For the height constraint, drag the stack view ...