make a flip animation when navigating from view to view
please i have problem in making flip animation when going from a view to another, i explain : i have found a tutorial in this url : http://www.youtube.com/watch?v=Rgnt3auoNw0 which explain me how to do, however the method of adding views in this tutorials and mine wasn`t the same, although i tried to put the co开发者_JS百科de that he used in my IBAction so my IBAction looks like that :
-(IBAction)goToRechercherView{
[UIView beginAnimations:@"flipview" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self.view cache:YES];
[self presentModalViewController:rechercherViewController animated:YES];
[UIView commitAnimations];
}
like that my app build succesfully but there is no transition when i navigate from my view where i have puted the iBAction, please help, thx in advance :)
You shouldn't need any of the animation code. Simply do this before the presentModalViewController:
rechercherViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
One thing that will help is to change animated: to NO on the presentModalViewController: line. I just ran into this yesterday in a similar scenario. You are basically asking the OS to animate something that is already being asked to animate. This should help.
This worked for me
Yourviewcontroller *obj = [[Yourviewcontroller alloc]init]; obj.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:obj animated:YES];
精彩评论