2012-11-20 65 views
1

我想了解如何让打开和关闭动画进入ios的书橱。谷歌搜索结果如下:bookcover翻转动画ios

coverimage.layer.anchorPoint=CGPointMake(0, .5); 
coverimage.center = CGPointMake(coverimage.center.x - coverimage.bounds.size.width/2.0f, coverimage.center.y); 
[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:1]; 
[UIView setAnimationDelay:0.1]; 
coverimage.transform = CGAffineTransformMakeTranslation(0,0); 
CATransform3D _3Dt = CATransform3DIdentity; 
_3Dt = CATransform3DMakeRotation(3.141f/2.0f,0.0f,-1.0f,0.0f); 
_3Dt.m34 = 0.001f; 
_3Dt.m14 = -0.0015f; 
coverimage.layer.transform =_3Dt; 
[UIView commitAnimations]; 

它工作的很好,但我发现很难理解它如何做CATransform3DMakeRotation。如果您遇到任何方向或资源,请告诉我。我的主要动机是找到一种方法,使其反转行动(关闭书的封面)。我试图改变代码,但没有奏效。提前致谢。

回答

3

下载的样本,并按照所需的输出的简单执行。检查这个.. Flip Animation

+1

非常感谢您AppleDelegate,也如果任何人有兴趣了解有很好的文章在这里:[链接] HTTP ://markpospesel.wordpress.com/2012/05/23/anatomy-of-a-page-flip-animation/ – snowflakes74