0

一个简短的问题。

我为 iPad 创建了一个应用程序,很像 iPhone 的实用程序应用程序(一个 mainView,一个 FlipSideView)。它们之间的动画是 UIModalTransitionStylePartialCurl。shouldAutorotateToInterfaceOrientation 返回 YES。

如果我在进入 FlipSide 之前旋转设备,一切正常,PartialCurl 显示正常。但是,如果我进入 FlipSide 然后旋转设备,而 UIElements 确实旋转并定位自己就好了,实际的“页面卷曲”保持其初始方向。它只是不会让步:)

这是一个已知问题吗?难道我做错了什么?谢谢!

4

2 回答 2

0

我也有这个问题,有点放弃了。然而,我向一位朋友提到了我的困境,他鼓励我研究子 VC 的逻辑,我回忆起我用来在父/子视图控制器之间传递数据的一个方便的技巧。

在您的反面视图控制器中,创建一个“rootViewController”属性。在您的父视图控制器中,当您初始化翻转视图控制器时,您设置(其中“self”是 rootVC):

flipsideController.rootViewController = self;

然后,您将其用于您的另一面 VC 的 shouldAutorotateToInterfaceOrientation 方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return interfaceOrientation == self.rootViewController.interfaceOrientation;
}

中提琴!翻转视图不再在部分卷曲的父视图下方旋转!

于 2010-06-04T03:19:04.990 回答
0

上述代码的最短方法是:

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return interfaceOrientation == self.parentViewController.interfaceOrientation;
}
于 2012-01-24T15:51:08.170 回答