presentModalViewController 和 pushViewController 在概念上各不相同。如果您只需要更改动画,则可能需要执行以下操作:
childBrowser.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
//childBrowser.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
//childBrowser.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//childBrowser.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[super.viewController presentModalViewController:modalViewController
animated:YES];
或者干脆使用传统动画(代码需要调整):
UIViewController *controller = [[[MyViewController alloc] init] autorelease];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self window] cache: YES];
[navController presentModalViewController: controller animated: NO];
[UIView commitAnimations];