从顶部/底部翻转UIViews [英] Flipping UIViews From Top / Bottom

查看:130
本文介绍了从顶部/底部翻转UIViews的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很清楚只有两个可用的UIView转换,UIViewAnimationTransitionFlipFromLeft和UIViewAnimationTransitionFlipFromRight。我想知道是否有可以实现/模拟UIViewAnimationTransitionFlipFromTop或UIViewAnimationTransitionFlipFromBottom。

I'm well aware that there are only two available UIView transitions, UIViewAnimationTransitionFlipFromLeft and UIViewAnimationTransitionFlipFromRight. I'm wondering if there is anyway that I can implement / emulate a UIViewAnimationTransitionFlipFromTop or UIViewAnimationTransitionFlipFromBottom.

我能想到的唯一方法是通过翻转x轴y轴,但我没有看到任何有关如何做到这一点的信息。仅设置每个轴的坐标不会解决问题,因为x轴直到x轴为止。

The only way I can think to do this is by flipping the x axis with the y axis, but I've not seen any information about how to do this. Just setting the coordinates of each axis won't fix the issue as the x-axis till remains the x-axis.

有没有人知道如何实现这一目标?

Does anyone have any ideas how this can be accomplished?

推荐答案

您可以通过将CATransform3D应用到主视图的CALayer来实现此目的,并在其背后使用辅助视图的CALayer。在此回复中,我指向Mac实施这个动画片由迈克李。您应该能够重用该代码的重要部分,以在iPhone上重新创建此效果。

You can do this by applying a CATransform3D to your main view's CALayer, with your secondary view's CALayer behind it. In this response, I point to a Mac implementation of this animation by Mike Lee. You should be able to reuse a significant portion of that code to recreate this effect on the iPhone.

这篇关于从顶部/底部翻转UIViews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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