views:

537

answers:

2

(By the way I develop without Interface Builder) If you have a tab bar app that autorotates, so all the autoresizing masks are set, how do you make it work with all the views? Like if one view autorotates to landscape, you select a different tab in the tab bar, and the view associated with that tab comes up, and its all messed because it never got autorotated, it got initialized with the frame that makes it fit in portrait mode, even though the autoresizingmasks are set to have it look fine in landscape, it never got rotated. Whats the solution? (By the way, I'm lazy loading the views, so the only view loaded at any given time is the view(view controller's view) associated with the selected tab)

Thanks!!

+1  A: 

Does declaring all the required orientations in the didrotatefrominterfaceorientation method in every view controller you are using fix the problem?

e.g. your main view, with the tab bar is called "mainView", and when you choose a tab, it loads a view called "firstView", does the "firstView" view controller have the orientations set?

Michael
A: 

If a view controller is not loaded, it won't be able to respond to autorotation messages. So in your view controller, when it's loaded from the nib, it should check the orientation and resize and move things as necessary.

lucius