开发者

PageTurn animation in iPhone

开发者 https://www.devze.com 2022-12-10 06:39 出处:网络
How to make page turn animation like the Stanza app ? Earlier i was using , but its not the animation i am looking for.

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

精彩评论

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