2010-06-23 9 views
0

J'ai implémenté une application d'animation.Dans lequel il y a une vue principale et une autre est sous-vue dans cette vue.Il y a aussi un bouton.Lorsqu'un utilisateur touche ce bouton je veux disply sous-vue avec animation.Cette vue doit être afficher à partir Comment est-ce possible.Je ne sais pas comment cela est possible.comment faire une animation UIView?

+0

voulez-vous utiliser [UIView beginAnimations: @ contexte "id": nil]? poster du code, s'il te plait. – Cesar

+0

oui je veux utiliser le code de type beloy: CGContextRef context = UIGraphicsGetCurrentContext(); \t [UIView beginAnimations: nil contexte: contexte]; \t [UIView setAnimationTransition: UIViewAnimationTransitionCurlUp pourView: thumbnailView cache: NO]; \t // [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; \t [UIView setAnimationDuration: 1.0]; \t // \t self.view.hidden = YES; \t [UIView commitAnimations]; – JohnWhite

Répondre

2

essayez le code suivant:

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:0.75]; 

// swap the views and transition 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp 
         forView:self.view 
         cache:YES]; 

[originalSubview removeFromSuperview]; 
[self.view addSubview:thumbnailView]; 

[UIView commitAnimations];