Reputation: 201
I'm attempting to have two buttons side by side that look correct across all devices but no matter what constraints I seem to add in I keep getting issues similar to this (one button larger then the other):
Any ideas what I'm doing wrong as far as adding in constraints? I'm not using code for this simply doing it through the InterfaceBuilder in Storyboard.
Constraints set:
Reply: Leading Space, Bottom Space, Height Equals :45, Trailing to Delete Button
Delete: Trailing Space, Bottom Space, 32:9 Ratio, Height Equals :45, Leading to Reply Btn
Upvotes: 6
Views: 2426
Reputation: 1780
According to me add following constraints
I had similar operations on one of my view, please see this picture for more info
Happy Codding :)
Upvotes: 3
Reputation: 3770
You need to add a constraint for equal widths, and also remove the '32:9 ratio' constraint, which is currently setting a width for the "Delete" button w/o having a set width for the "Reply" button. That's what's causing the issue.
If you then still have the leading & trailing edges pinned to their respective sides of the container view, and set the space between them to zero, then you should be good.
Upvotes: 2
Reputation: 1217
With both buttons selected, go to Editor > Pin > Widths Equally. Then set the height, leading/trailing space, space between the buttons, and bottom space.
Upvotes: 13