开发者

CATransition page curl from top

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.3开发者_如何学编程5];
 [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.


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


Found the answer, need to set subtype to from right!


subtype = KCATransitionFromLeft or KCATransitionFromRight 

you can also remove the animation.endProgress if you want a total animation of curl page . =)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜