Reputation:
Recently, I have needed to split this button so that they are constrained with the same height but different widths, split 60 - 40, along the screen. They also have to respond to any Iphone / Ipad screen. I currently have them set within a stack view so that they are positioned correctly yet this is not optimal and do not allow me to modify their width.
Is there a XCode creator solution? If not, is there a solution in code?
Images:
Upvotes: 0
Views: 372
Reputation: 77423
You can use Proportional Widths.
Clear
button to the Start
button and select Equal Widths
40:60
(for clarity... it could just as well be 4:6:
or 2:3
). The Equal Width
label on the constraint will change to Proportional Width
Alignment: Fill
/ Distribution: Fill
/ Spacing: (however much you want)
That should do it :)
Upvotes: 0