翻转过渡在横向模式下从顶部翻转视图 [英] flip transition flips view from top in landscape mode

查看:58
本文介绍了翻转过渡在横向模式下从顶部翻转视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码进行翻转转换.

I am using this code to for flip transition.

MyViewController *viewController = [[MyViewController alloc] init];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES];
[self.navigationController pushViewController:viewController animated:NO];
[UIView commitAnimations];
[viewController release];

但不是从右翻转,而是从顶部翻转.我的应用程序只能在横向模式下工作.

But instead of fliping from right, its flipping from top. My application works only in landscape mode.

请帮助.

推荐答案

在定义动画常量时已考虑了纵向模式.如果将应用程序定义为仅横向模式,则必须将头倾斜90度来考虑这些动画常数.

The animation constants have been defined with portrait mode in mind. If you define your application to be landscape mode only, you have to think about these animation constants with your head tilted 90 degrees.

假设您的设备顶部位于标题的左侧,而不是设置动画的位置

Let's say your device's top is titled to the left, than you would set the animation with

[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:YES];

,它将从右侧卷曲.这是因为在这种情况下,设备的底部朝右.

and it would curl from the right. That's because the bottom of the device faces to the right in this case.

不好的是没有定义UIViewAnimationTransitionFlipFromBottom.我想您可以将动画的坐标系旋转90度,但是我帮不上忙.

The bad thing is that UIViewAnimationTransitionFlipFromBottom is not defined. I guess you could rotate the coordinate system of the animation with 90 degrees, but I can't help you with that.

这篇关于翻转过渡在横向模式下从顶部翻转视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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