开发者

how to add flip screen animation on button click programmatically

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜