1

谁能告诉下面这个代码片段的块动画等效?

[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];
4

2 回答 2

13
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];
于 2012-05-24T13:00:10.533 回答
1
UIView: + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion
于 2012-05-24T12:34:12.337 回答