【问题标题】:iphone: How to do kCATransitionPush without any fade? [duplicate]iphone:如何在不褪色的情况下进行 kCATransitionPush? [复制]
【发布时间】:2010-08-17 17:55:47
【问题描述】:

可能重复:
iPhone CATransition adds a fade to the start and end of any animation?

我想要两个子视图之间的推送动画,就像 ScrollView 分页模式一样。

我知道我可以直接使用 UIScrollView,但是我的程序的逻辑不太一样。

无论如何,我可以使用 kCATransitionPush 动画,但不好的是它在推动时会褪色。

我真的很讨厌这种褪色,谁能告诉我如何去除这种褪色??

或者如何在两个子视图之间进行类似 UIScrollView 的分页推送?

非常感谢。

【问题讨论】:

    标签: iphone animation paging


    【解决方案1】:

    只需使用普通的 UIView 动画。您可以使用基于块的动画,但我更喜欢“传统”风格,因为它适用于 3.0:

    CGRect pageFrame = currentPage.frame;
    CGFloat pageWidth = pageFrame.size.width;
    nextPage.frame = CGRectOffset(pageFrame,pageWidth,0);
    [UIView beginAnimations:nil context:NULL];
    currentPage.frame = CGRectOffset(pageFrame,-pageWidth,0);
    nextPage.frame = pageFrame;
    [UIView commitAnimations];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-10
      • 1970-01-01
      • 2014-07-10
      • 2021-10-01
      • 2017-01-23
      • 2020-03-05
      相关资源
      最近更新 更多