Reputation: 5089
I have the view controller above with the layout you see. I want to center all of this horizontally. So keep it in its current layout, and when orientation is changed to landscape, have the elements in that layout but centered. How can I do this? I tried using IB to center horizontally but it piled them all in the center without keeping the layout.
Upvotes: 2
Views: 239
Reputation: 51
The best approach if possible for you to change is to use UIStackView which arranges its subviews in any mode(landscape or portrait) You can refer http://www.appcoda.com/stack-views-intro/ if you are new to UIStackView.
Upvotes: 0
Reputation: 22559
A very quick fix:
If you are using autoresizing mask: Just remove all the masks as follows:
Upvotes: 2