如何使UIViewAnimationTransitionCurlUp在相反方向? [英] How to make UIViewAnimationTransitionCurlUp in reversed direction?

查看:408
本文介绍了如何使UIViewAnimationTransitionCurlUp在相反方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的应用程序,它允许在某些情况下的界​​面翻转。无论横向应该得到支持(景观左和右)。设备翻转和方向的变化工作得很好,但是,当在横向模式下,应用程序允许使用UIViewAnimationTransitionCurlUp影响到另一个屏幕,然后回来UIViewAnimationTransitionCurlDown。

I'm working on the app which allows flipping of the interface under some circumstances. Both landscape orientation should be supported (landscape left and right). Device flipping and orientation changes works fine, however, when in landscape mode, application allows to go to another screen using UIViewAnimationTransitionCurlUp effect and then back with UIViewAnimationTransitionCurlDown.

这工作得很好,当方向是横向向左(从左下角卷曲页,再返回)。但是,当在横向右方向,坐标反转 - 左下角实际上是在此情况下右上方,所以动画过渡效果反转过,这是不希望的行为

This works fine when orientation is landscape left (curl page up from the left bottom corner and then back). But when in landscape right orientation, coordinates are reversed - the bottom left corner is actually upper right in that case, so animation transition effect is reversed too, which is not desired behavior.

有一些方法如何使其出现在两个方向或某种方式如何产生这种效果手动(可能使用核心动画?)相同的转换这种动画

Is there some way how to transform this kind of animation so it appears the same in both orientations or some way how to create this effect "manually" (perhaps using Core Animation?).

感谢有这方面的技巧。

推荐答案

的转变方向是根据Home键始终设置,即在每个方向上/下/左/右测量按Home键。如果你想拥有的转变方向,一个方向,根据设备的方向,您必须使用条件,申报方向为每个方位的:

The transition direction is always set according to the Home button, that is, in each orientation the up/down/right/left is measured according to the Home button. If you want to have the transition direction in one direction according to the device orientation, you must use conditions to declare the direction for each of orientations:

  UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];


if (UIDeviceOrientationIsPortrait(currentOrientation))
{

}

else if (UIDeviceOrientationIsLandscape(currentOrientation))
{

}

这当然也包括只有两个方向。你需要更多的工作在这,如果你想为每个四个方向过渡个人风格。

This of course includes two orientations only. You need to work more on this if you want individual transition styles for each four orientations.

P.S。 JUST A迟到的回答! : - /

P.S. JUST A LATE ANSWER! :-/

这篇关于如何使UIViewAnimationTransitionCurlUp在相反方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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