Marcus Zarra posted a great solution for this on the SDK mailing list:
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];
There are transitions for flipping and curling pages. If you are attenuated, you can try setting up a new alpha view:
UIViewController *controller = [[[MyViewController alloc] init] autorelease]; controller.view.alpha = 0.0; [navController presentModalViewController: controller animated: NO]; [UIView beginAnimations: nil context: nil]; controller.view.alpha = 1.0; [UIView commitAnimations];
However, what you probably want is a crossfade, or at least a fade out. When the UINavigationController switches to the new view, it deletes the old one. For this effect, you're probably better off simply adding a new view to an existing UIViewController and fading out its alpha over time.
Note. If you are not in your application deletion, [self window] will not work. Use self.view.window, thanks to user412500 post to indicate this.
Ben Gottlieb Oct 26 '08 at 1:46 2008-10-26 01:46
source share