How can I force one of my viewcontrollers to be full screen and landscape in iOS? My app is in portrait mode but I want that only one of the views is landscape and fullscreen.
I tried this solution which consists off implementing CustomUINavigationController with the following method and adding the shouldAutorotate methods in my viewcontroller I want to rotate:
//Custom UINAvigationController
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscapeRight;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate{
return YES;
}
//UIViewController I want to automatically rotate
- (NSUInteger)supportedInterfaceOrientations
{
return self.topViewController.supportedInterfaceOrientations;
}
I guess my problem it is related with the view's herachy. It works if my ViewController is my initial view controller but not with all the views. I have a custom menu and a placeholder (view) where I display all the other views. The viewcontroller I want to be landscape and fullscreen comes from a view which goes inside the placeholder, maybe this is the problem but I don't now how to solve it.