2009-11-03 4 views
3

Comment faire pour tourner la page animation comme l'application Stanza?PageTurn animation dans l'iPhone

Plus tôt je l'utilisais, mais ce n'est pas l'animation que je cherche.

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

Merci

Répondre

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

Cela fait la page animation boucle. Pour le flip, utilisez la constante UIViewAnimationTransitionFlipFromLeft ou UIViewAnimationTransitionFlipFromRight.