I want all my views to be in Portrait mode. This works except when I push a UINavigationController
onto another one. In this case the views inside the secondaryNavigationController
will adhere to device orientation instead. Here is how I'm calling the UINavigationControllers
.
[secondaryNavigationController setNavigationBarHidden:YES];
[[appDelegate secondaryNavigationController navigationBar] setHidden:YES];
[mainNavigationController presentModalViewController:[appDelegate secondaryNavigationController] animated:YES];
All my views implement this method but it doesn't seem to help.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}