开发者

PageTurn animation in iPhone

How to make page turn animation like the Stanza app ?

Earlier i was using , but its not the animation i am looking for.

   [CATransaction begin];
   CATransition *animation = [CATransition animation];

   [animation setType:(prevPage ? @"pageUnCurl" : @"pageCurl")];

   [animation setDuration:0.7f];
   [animation setFillMode: ( prevPage ? kCAFillModeBackwards : kCAFillModeForwards )];
   [animation setTimingFunction:[CAMediaT开发者_如何学运维imingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
   [[self layer] addAnimation:animation forKey:@"transitionViewAnimation"];
   [CATransaction commit];

Thanks


[UIView beginAnimations:@"yourAnim" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag];
...
[UIView commitAnimations];

This does the page curl animation. For the flip, use the UIViewAnimationTransitionFlipFromLeft or UIViewAnimationTransitionFlipFromRight constant.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜