Reputation: 7456
I was trying to put two buttons right next to each other, one taking up the left half of the screen, and the other taking up the right half of the screen. I found it perplexing that when I set Horizontal Center In Container for both of them that the left button had the property set correctly (center of button), but that the right button had the property set to the center of the View Controller!
I looked into this further and discovered that it takes this behavior whenever its on the right side:
In my pictures, I'm using a UIView with a black background, but it is applicable to anything. Is this the desired behavior? How else would I have two buttons laid out like I stated above?
Upvotes: 0
Views: 1058
Reputation: 999
You can put your two buttons embebed in a UIView then put a Horizontal center Constraint in that UIView
Upvotes: 0
Reputation: 1734
Why do you use Horizontal Center In Container for your task? It should make both buttons appear in the centre of the container.
Do this instead:
Upvotes: 3