gpt4 book ai didi

ios - 模态视图 Controller 优于呈现 View Controller

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:26:49 25 4
gpt4 key购买 nike

我有一个 View Controller ,我在另一个 View Controller 上以模态方式呈现,并且顶部 VC 的背景 View 具有模糊效果。当我使用以下代码时,顶部 View Controller 出现在底部 View Controller 之上,但顶部 Controller 隐藏在导航栏后面:

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

当我删除行 settingsViewController.modalPresentationStyle... 时,新的 View Controller 出现在导航栏上,但呈现的 View Controller 变成黑色,并破坏了模糊效果。

如何混合使用这两种呈现方式,使呈现 View Controller 保持可见,而导航栏位于呈现 View Controller 下方?

最佳答案

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

关于ios - 模态视图 Controller 优于呈现 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27592569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com