I have a horizontal UIStackView
with 2 views within it. I'd like to have the left view take up ~70% of the screen, and the right view take up the remaining 30%. I know that I can set the UIStackView
alignment to Fill and the distribution to Fill and that will allow me to have more control over my subview sizes. What I can't figure out is how to set the layout constraints/widths/etc. on the subviews so that the the 70/30 ratio is correct, particularly when the device is rotated?
Can anyone explain how to set the constraints on my subviews so that the 70/30 ratio is maintained across device rotations?
You should be able to do this by creating an equal width constraint for the two views. Then, set the multiplier to that constraint to 0.7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With