【问题标题】:UIPageViewController transition speed / duration?UIPageViewController 转换速度/持续时间?
【发布时间】:2012-03-27 18:22:56
【问题描述】:

有什么方法可以改变页面卷曲过渡的默认持续时间吗? 我希望它是快速的方式吗?

谢谢 沙尼

【问题讨论】:

  • 这里我需要开发 iBook 应用程序,您有什么想法吗?请帮帮我
  • 呃。不敢相信没有办法指定这一点。
  • @dineshprasanna 是的,有办法开发 iBook 类应用程序。请单独发布您的问题
  • @ChitraKhatri 感谢您的回复,如果有任何示例代码,请在此电子邮件中分享“dineshprasanna1987@gmail.com”
  • 你找到方法了吗?

标签: ios5 uipageviewcontroller


【解决方案1】:

这是使用默认过渡来卷曲页面并指定卷曲速度的方法。

        CATransition *animation = [CATransition animation];
        [animation setDelegate:self];
        [animation setDuration:1.0f];
        animation.startProgress = 0.2;
        animation.endProgress   = 1;
        
        if (isGoingBackward) {
            [animation setType:@"pageUnCurl"];
            [animation setSubtype:kCATransitionFromTop];
        }
        else
        {
            [animation setType:@"pageCurl"];
            [animation setSubtype:kCATransitionFromLeft];
        }

        [animation setFillMode: kCAFillModeBackwards];
        [self.view.layer addAnimation:animation forKey:@"animation"];

【讨论】:

  • 谢谢。我会测试这个
  • 欢迎您,如果这是您要找的,请接受答案。
  • isFixedLayout 是什么?!如何将它连接到我的self.pageViewController
  • 对不起,isFixedLayout 只是一个与我的代码相关的布尔值,我编辑了代码以便更有意义。
  • 为了应用 curl 到你的 pageViewController: [self. pageViewController addAnimation:animation forKey:@"animation"];
猜你喜欢
  • 1970-01-01
  • 2017-08-30
  • 2011-06-20
  • 2013-11-23
  • 1970-01-01
  • 2020-09-05
  • 2012-04-07
  • 2017-02-23
  • 1970-01-01
相关资源
最近更新 更多