I Have to divide a UIView
horizontally into three even sized subviews using Xcode
. I tried to use constraints.
I got the following result.
First, hold "control" key and drag the view to its container view,
To set view's width equal to container view's width:
Second, change the multiplier value to 0.3333(means 1/3 width of container):
Next, set 2nd view's width equal to the 1st one:
Finally, add 3rd view and apply same set as 2nd one. And remember to add "Same Vertical Center to 1st View" constraint and "xx Leading Space" constraint for 2nd and 3rd view. You will get three same width views fill the container.