任何人都可以告诉块动画相当于以下代码片段吗?
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:self.navigationController.view cache:NO];
NextViewController *next = [[NextViewController alloc]
initWithNibName:@"NextViewController" bundle:nil];
[self.navigationController pushViewController:next animated:YES];
[next release];
[UIView commitAnimations];
答案 0 :(得分:12)
NextViewController *next = [[NextViewController alloc] initWithNibName:@"NextViewController" bundle:nil];
[UIView transitionWithView:self.navigationController.view
duration:0.75
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^{
[self.navigationController pushViewController:next animated:NO];
}
completion:nil];
答案 1 :(得分:1)
UIView: + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion