Reputation: 197
I have 5 controllers in my Application and i am adding those controllers as [window addSubview:navController.view]; And array of 5 controllers given to navController which is UINavigationController.
Please help, on how to apply orientation support on those 5 view controllers?. I have tried shouldAutoRotate to YES. But it does not work.
Upvotes: 1
Views: 87
Reputation: 3136
Change you code from:
[self.window addSubview:aController.view];
to
self.window.rootViewController = aController;
Also add the following methods for orientation support
shouldAutorotate -return YES
supportedInterfaceOrientations- return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
Upvotes: 1