views:

1602

answers:

1

Hi All,

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:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
   [[self layer] addAnimation:animation forKey:@"transitionViewAnimation"];
   [CATransaction commit];

Thanks

+3  A: 
[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.

Pascal