Reputation: 6581
I have a UIStackView that holds 3 UIButtons, A, B, and C, horizontally in that order. The UIStackView is added to a subview of UIViewController's view when device is in Landscape mode. But when the device rotates to portrait mode, I want:
Is there an easy way to achieve it in Storyboard without programming or I need to change the autolayout constraints programmatically every time device auto-rotates?
Upvotes: 0
Views: 1128
Reputation: 535945
I didn't have much trouble doing a simulation of (1) in Interface Builder alone in Xcode 9 beta:
But it's just a simulation — your spec seems to require that we change the order of the arranged subviews, and that obviously requires programming — and none of your spec would be possible without programming in Xcode 8 and before. (And I didn't understand the meaning of (2) so I didn't attempt it.)
But why be afraid of a little programming? Changing things programmatically at rotation time is part of life; you should get used to it.
Upvotes: 2