I wanted to know if anyone managed a pagecurl from the top using the CATRANSITION. I have the following :
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.subtype = kCATransitionFromTop;
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.30;
[animation setRemovedOnCompletion:NO];
[self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
but unfortunately, it always does the page curl from the bottom. I will be very grateful if anyone can tell me how to do a page curl from the top.
Many thanks.
Found the answer, need to set subtype to from right!
user363349
I've got this working. You need to set animation.type = @"pageUnCurl"; - who would have thought! Thanks apple.
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.5];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
animation.type = @"pageUnCurl";
animation.subtype = kCATransitionFromTop;
animation.fillMode = kCAFillModeForwards;
animation.startProgress = 0.3;
[animation setRemovedOnCompletion:NO];
[self.helpView.layer addAnimation:animation forKey:@"pageCurlAnimation"];
soufiane
subtype = KCATransitionFromLeft or KCATransitionFromRight
you can also remove the animation.endProgress if you want a total animation of curl page . =)
来源:https://stackoverflow.com/questions/3652724/catransition-page-curl-from-top