iphone:如何在不卷曲的情况下实现页面翻转效果?

时间:2013-04-25 06:51:42

标签: iphone ios core-animation core-graphics page-flipping

我需要在iOS应用中实现页面翻转效果。但是效果不应该像UIPageViewController和我检查过的其他一些第三方库那样卷曲页面。页面应该是一个严格的页面作为贺卡的页面,而不是书籍。我必须实现如下图所示的内容。

enter image description here

如果有人能提供任何建议或示例代码我真的很感激。

提前谢谢!!

3 个答案:

答案 0 :(得分:3)

您需要了解Core Foundation如何进行3D转换。

这篇文章的答案包含了你应该需要的所有链接。

How is CATransform3DMakeRotation used?

答案 1 :(得分:2)

你可以这样做:

[UIView beginAnimations:@"View Flip" context:nil]; 
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
[UIView setAnimationTransition:
UIViewAnimationTransitionCurlUp forView:self.view cache:NO];
[UIView commitAnimations];

答案 2 :(得分:1)

这对你有帮助。

-(void) animateMe:(UIViewAnimationTransition)style
{
   [self playCardSound];
   [UIView beginAnimations:@"flipview" context:nil];
   [UIView setAnimationDuration:0.5];
   [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
   [UIView setAnimationTransition: style forView:self.view cache:YES];
   [UIView commitAnimations];
}

称之为:

[self animateMe:UIViewAnimationTransitionFlipFromLeft];
[self animateMe:UIViewAnimationTransitionFlipFromRight];