简体   繁体   中英

Modal view controller over Presenting view controller

I have a view controller that I am presenting modally over another view controller, and the background view for the top VC has a blur effect. When I am using the following code, the top view controller appears over the bottom view controller, but the top controller is hidden behind the navigation bar:

MOSettingsViewController *settingsViewController = [[MOSettingsViewController alloc]init];
settingsViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
settingsViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
self.providesPresentationContextTransitionStyle = YES;
self.definesPresentationContext = YES;
[self presentViewController:settingsViewController animated:YES completion:nil];

When I remove the line settingsViewController.modalPresentationStyle... , the new view controller appears over the navigation bar, but the presenting view controller turns black, and ruins the blur effect.

How can I get a mixture of these two presentations, where the presenting view controller stays visible and the navigation bar is under the presented view controller?

而不是使用UIModalPresentationOverCurrentContext ,我需要使用UIModalPresentationOverFullScreen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM