当我使用父视图控制器
这是我的代码:
UINavigationController
的 modalPresentationStyle
设置为 UIModalPresentationCurrentContext
时,展示我的 UIViewController
时没有滑入的过渡效果。这是我的代码:
UIViewController *viewController = [[UIViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
navController.navigationBarHidden = YES;
self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:navController animated:YES completion:nil];
当我不设置modalPresentationStyle
时,一切都正常工作。但我需要这种样式,因为我希望UIViewController
作为覆盖层呈现。
顺便说一句: 当ViewController
被解除显示时,动画效果也很好。