UINavigationController back button half works in iPad landscape orientation

守給你的承諾、 提交于 2019-12-21 04:42:06

问题


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:


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.



来源:https://stackoverflow.com/questions/2770477/uinavigationcontroller-back-button-half-works-in-ipad-landscape-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!