【问题标题】:iphone : How to implement the page flip effect without curl?iphone:如何实现不卷曲的翻页效果?
【发布时间】:2013-04-25 06:51:42
【问题描述】:

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

如果有人能提供任何建议或示例代码,我将不胜感激。

提前谢谢你!!

【问题讨论】:

  • 您应该查看markpospesel.wordpress.com/tag/catransform3d 了解更多信息
  • 你能告诉我你看过这个动画的应用的名字吗
  • @Leena 它还没有在应用商店中。我正在做这个。
  • @Micazeve 和 Sharon Nathaniel,感谢您提供的链接。我检查了链接,但无法弄清楚如何根据需要修改这些库。他们都从中心折叠页面。但在我的情况下,它必须只是从页面左边缘翻页。它实际上是一张简单的两页贺卡。

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


【解决方案1】:

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

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

How is CATransform3DMakeRotation used?

【讨论】:

    【解决方案2】:

    你可以这样做:

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

    【讨论】:

      【解决方案3】:

      这会对你有所帮助。

      -(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];
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-04-19
        • 2011-07-22
        • 1970-01-01
        • 1970-01-01
        • 2020-01-08
        • 1970-01-01
        • 2015-08-31
        • 1970-01-01
        相关资源
        最近更新 更多