使用核心动画开门效应

使用核心动画开门效应

本文介绍了使用核心动画开门效应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在UIView上创建一个转换/动画,看起来像下面的链接中的图像。它将从一个标准的矩形形状的UIView开始,然后视图将动画/过渡,像左侧被推动,它在右侧角旋转,像一个小门打开。我相信这是一个很容易做的核心动画,我试图搜索解决方案,但没有找到任何例子。

I'm trying to create a transition/animation on a UIView that looks something like the image in the link below. It would start with a UIView that is a standard rectangle shape, the view would then animate/transition like the left side is being pushed and it rotates on the right side corner, like a door opening slightly. I'm sure this is a really easy thing to do in Core Animation, and I've tried searching for solutions, but haven't found any examples.

这是我想要实现的示例:

Here's an example of what I am trying to achieve:

推荐答案

希望实现是相当直接,如果你不担心添加任何阴影或照明的门。

What you're hoping to achieve is fairly straight-forward if you aren't worried about adding any shading or lighting to the door.

从此论坛查看此信息:

Check out this post from this forum:UIView perspective transform

它应该指向正确的方向。你必须用门的实际位置(即使透视可信),但这里的代码应该给你一个好主意,如何变换UIView(一个CALayer真的)。

It should point you in the right direction. You'll have to play around with the actual position of the door (ie making the perspective believable) but the code here should give you a good idea of how to transform the UIView (a CALayer really).

祝你好运,
James

Good luck,James

这篇关于使用核心动画开门效应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 09:22