UIView 动画:PartialCurl ...旋转期间的错误? [英] UIView Animation: PartialCurl ...bug during rotate?

查看:30
本文介绍了UIView 动画:PartialCurl ...旋转期间的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简短的问题.

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

I've created an app for the iPad, much like a utility app for the iPhone (one mainView, one flipSideView). The animation between them is UIModalTransitionStylePartialCurl. shouldAutorotateToInterfaceOrientation is returning YES.

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

If I rotate the device BEFORE entering the FlipSide, everything is okay and the PartialCurl is displayed okay. But if I enter the FlipSide and then rotate the device, while the UIElements do rotate and position themselves just fine, the actual "page curl" stays with its initial orientation. it just won't budge :)

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

Is it a known issue? am I doing something wrong? Thanks!

推荐答案

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

I too had this issue and somewhat gave up. However, I mentioned my dilemma to a friend, who encouraged me to look into the child VC's logic and I recalled a handy trick that I've used to pass data between parent/child view controllers.

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

In your flipside view controller, create a "rootViewController" property. In your parent view controller, when you initialize the flipside view controller, you set (where "self" is the rootVC):

flipsideController.rootViewController = self;

然后您将其用于您的反面 VC 的 shouldAutorotateToInterfaceOrientation 方法:

You then use this for your flipside VC's shouldAutorotateToInterfaceOrientation method:

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

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

Viola! The flipside view no longer rotates underneath the partially curled up parent view!

这篇关于UIView 动画:PartialCurl ...旋转期间的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆