Marcus Zarra đăng một giải pháp tuyệt vời để này vào danh sách gửi thư SDK:
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];
Có hiệu ứng chuyển tiếp cho lật và trang-uốn. Nếu bạn được đặt ở chế độ mờ dần, bạn có thể thử điều chỉnh chế độ xem alpha mới của mình:
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];
Tuy nhiên, những gì bạn có thể muốn là ghép hoặc ít nhất là mờ dần. Khi UINavigationController chuyển sang chế độ xem mới, nó sẽ loại bỏ chế độ xem cũ. Đối với hiệu ứng này, bạn có lẽ tốt hơn hết chỉ cần thêm một cái nhìn mới cho UIViewController hiện tại của bạn và mờ dần alpha của nó theo thời gian.
Lưu ý: Nếu bạn không ở trong ứng dụng ủy quyền [cửa sổ tự] sẽ không hoạt động. Sử dụng self.view.window, nhờ vào bài viết của user412500 để chỉ ra điều này.
Nguồn
2008-10-26 01:46:43
Đây là cũ! Xem câu trả lời của Simo Salminen dưới đây! MrDatabase bạn nên chuyển đổi này –