UINavigationController back button half works in i

2019-03-28 05:27发布

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.

1条回答
Deceive 欺骗
2楼-- · 2019-03-28 06:27

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.

查看更多
登录 后发表回答