【问题标题】:iphone page curl without uiviewanimation没有uiview动画的iphone页面卷曲
【发布时间】:2010-09-06 15:01:03
【问题描述】:

我正在尝试使用以下内容进行部分页面卷曲:

    CATransition *animation = [CATransition animation];
    [animation setDelegate:self];
    [animation setDuration:1.0f];
    [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
    [animation setType:(notCurled ? @"mapCurl" : @"mapUnCurl")];
    [animation setRemovedOnCompletion:NO];
    [animation setFillMode: @"extended"];
    [animation setRemovedOnCompletion: NO];
    notCurled = !notCurled;
    [[delegate.window layer] addAnimation:animation forKey:@"pageFlipAnimation"];

不幸的是,它什么也没做。我正在使用最新的 SDK。我记得能够在 3.0 中使用它。

谢谢。

【问题讨论】:

    标签: iphone objective-c catransition


    【解决方案1】:

    好的,上面的似乎不再起作用了,我现在正在使用以下:

    CATransition *animation = [CATransition animation];
            [animation setDelegate:self];
            [animation setDuration:0.35];
            [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
                animation.type = @"pageCurl";
                animation.fillMode = kCAFillModeForwards;
                animation.endProgress = 0.65;
            [animation setRemovedOnCompletion:NO];
            [self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
    

    【讨论】:

    • 另外,有谁知道如何更改默认的 pagecurl 行为。它目前从底部到顶部卷曲。我尝试将动画子类型更改为 kCATransitionFromTop 但这似乎不起作用。
    • 如果有机会,您能否编辑这篇文章以添加 CODE 反引号以使替换代码更具可读性?谢谢!
    • 您好,我对其进行了编辑以使其更具可读性。不幸的是,pagecurl 调用将被拒绝。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多