Hello I have an app where is the following hierarchy of controllers:
- UITabBarCOntroller
- Navigation Controller with Table ViewController
- UIView controller
The situation is following. I would like to have all the navigation controllers in portrait and only the last controller should be in Landscape. To be correct Landscape Left.
Now the problem is: When I push the new Controller (last one) i want the orientation to be landscape left. I have overrided the methods shouldAutorotate and shouldAutorotateToInterfaceOrientation. I also overrided method supportedInterfaceOrientations with mask LandscapeLeft?
Am I missing something?
I also implement all the rotation methods in the navigation and tabbar controller. in the tabbar :
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// You do not need this method if you are not supporting earlier iOS Versions
return [self.selectedViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.selectedViewController supportedInterfaceOrientations];
}
-(BOOL)shouldAutorotate
{
return YES;
}
and in the navigation controller :
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
-(BOOL)shouldAutorotate
{
return YES;
}
Any help will be greatly appreciated.
These are the methods imlemented in the last controller
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;
}