Reputation: 2942
I have a quick question according auto layout. Maybe I am missing something, but since two hours I am trying to align 3 views next to each other with same width. My goal is that each view is using 1/3 of the screens with. After autorotation all views should have each the same width, but all views next to each other should have a total width of the superview.
My idea looks like this:
Doing this programmatically is kind of easy. Is it possible to solve this task by only using interface builder?
Upvotes: 5
Views: 2627
Reputation: 14030
Upvotes: 4
Reputation: 4523
Yes just set it as the same size as parent view (then change it to 1:3 ratio) and set leading constraints to 0. You do this by ctrl dragging the view you want to it's super view. There you select the Equal Widths
property.
Like this, but 1:3 ratio
Upvotes: 6