2012-11-20 4 views
1

J'essaie de comprendre comment obtenir le livre d'ouverture et de fermer l'animation en cours dans ios. Google recherche a donné ceci:bookflip flip animation ios

coverimage.layer.anchorPoint=CGPointMake(0, .5); 
coverimage.center = CGPointMake(coverimage.center.x - coverimage.bounds.size.width/2.0f, coverimage.center.y); 
[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:1]; 
[UIView setAnimationDelay:0.1]; 
coverimage.transform = CGAffineTransformMakeTranslation(0,0); 
CATransform3D _3Dt = CATransform3DIdentity; 
_3Dt = CATransform3DMakeRotation(3.141f/2.0f,0.0f,-1.0f,0.0f); 
_3Dt.m34 = 0.001f; 
_3Dt.m14 = -0.0015f; 
coverimage.layer.transform =_3Dt; 
[UIView commitAnimations]; 

Il fonctionne très bien, mais je trouve qu'il est difficile de comprendre comment il fait le CATransform3DMakeRotation. Si vous avez rencontré une direction ou des ressources, faites-le moi savoir. Mon motif principal est de trouver un moyen pour inverser l'action (Fermer la couverture du livre). J'ai essayé de changer le code mais je n'ai pas travaillé. Merci d'avance.

Répondre

3

Téléchargez l'exemple et suivre la simple exécution de la sortie désirée .. Cochez cette case .. Flip Animation

+1

Merci beaucoup AppleDelegate, aussi si quelqu'un d'autre est intéressé à comprendre, il est bon article ici: [lien] http : //markpospesel.wordpress.com/2012/05/23/anatomy-of-a-page-flip-animation/ – snowflakes74