Reputation: 939
I've designed a xib for iPhone in Landscape mode which has a fullscreen view containing many subviews.
Is it possible to automatically adapt it to Portrait as sketched here: http://img850.imageshack.us/img850/5523/5cxw.jpg without having to create tons of contraints for each subview?
Upvotes: 0
Views: 227
Reputation: 9006
Enclose all the subviews in the new UIView
. Set leading, trailing, top and bottom constraints between the new view and the main view. Then in willRotateToInterfaceOrientation:duration:
set correct constant
's of these constraints. In landscape they should all be equal to 0. In portrait set them accordingly to get the look you're looking for.
Upvotes: 1