iphone page curl without uiviewanimation

2019-09-14 17:16发布

I am trying to do a partial page curl with the following:

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

Unfortunately, it does not do anything . I am using the latest SDK. I remember being able to use this in 3.0.

Thanks.

1条回答
Lonely孤独者°
2楼-- · 2019-09-14 17:47

Ok it seems that the above does not work anymore, I am using the following now:

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"];
查看更多
登录 后发表回答