UINavigationController后退按钮一半在iPad横向工作 [英] UINavigationController back button half works in iPad landscape orientation
问题描述
在带有UINavigationController的iPad应用程序中,一切都在纵向模式下工作,但在横向模式下,后退按钮有时只会返回半个级别。也就是说,在第一次按下时,标题栏会动画,好像它正在弹出一个控制器,而在第二次按下时,它会动画内容弹出。
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.
有没有人找到解决这个问题?这个问题中的矛盾解决方案没有帮助。我在导航控制器中有一个shouldAutorotate方法,但没有其他方法。
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;
}
编辑:
实际上,第一次点击弹出内容,第二次点击弹出导航栏。
actually, the first click pops the content and the second click pops the navigation bar.
推荐答案
as David F 想通了,但我没有理解,每个视图控制器必须实现一个shouldAutorotate方法,如果导航控制器。即使它会继续旋转,你在iPhone上也不需要它,但不知何故,iPad认为视图控制器需要双重弹出,如果它没有响应那个方法,结果与导航控制器相同。
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.
这篇关于UINavigationController后退按钮一半在iPad横向工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!