I want to flip the view on button click prog开发者_如何学Crammatically.
Use + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion with UIViewAnimationOptionTransitionFlipFromRight or UIViewAnimationOptionTransitionFlipFromLeft for the options parameter.
Please find the following code
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view] cache:YES];
[[self view] addSubview:secondaryView];
[UIView commitAnimations];
Please write the above code in the button action.
In the code second view refers, the view which you want to show after flip.
精彩评论