在iPhone应用程序中弹出视图控制器时出现动画错误

时间:2009-08-05 23:39:18

标签: iphone view navigation controller

我最近添加了横向自动旋转到我的基于iPhone导航的应用程序,但是我有一个奇怪的问题,我不知道如何修复或我的代码是否甚至是杯子。奇怪的是因为我按照Apple开发人员中心的自动旋转文档实现了所有内容(响应于shouldAutorotateToBlaBla并确保我的视图自动正确调整)。

问题在于,在正确推动视图控制器时,将它们弹出,导致动画有时会移动20px,然后在屏幕上设置动画,而不是相对于当前旋转从右到左。

换句话说,当你在横向视图控制器中点击Back,而不是在屏幕右侧动画时,它会垂直向下动画,就像它处于纵向方向一样。

任何线索?

1 个答案:

答案 0 :(得分:1)

我有这个错误,但是通过在我的每个视图控制器中实现这个UIViewController方法来修复它。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return interfaceOrientation == UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}