Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UINavigationController back button half works in iPad landscape orientation

In an iPad application with a UINavigationController, everything works in portrait mode but in landscape mode the back button sometimes only goes back half a level. That is to say, on the first press the title bar animates as if it was popping a controller, and on the second press it animates the content popping.

Has anyone found a solution to this? The contradictory solution in this question did not help. I have a shouldAutorotate method in the navigation controller but no others.

-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)inOrientation {
    return YES;
}

Edit:

actually, the first click pops the content and the second click pops the navigation bar.

like image 804
drawnonward Avatar asked May 05 '10 03:05

drawnonward


1 Answers

As David F figured out but I did not grok, every view controller must implement a shouldAutorotate method if the navigation controller does. Even though it will go ahead and rotate, and you do not need it on the iPhone, somehow the iPad thinks a view controller needs a double pop if it does not respond to that method with the same result as the navigation controller.

like image 65
drawnonward Avatar answered Sep 28 '22 09:09

drawnonward