gpt4 book ai didi

ios - 在 iOS 9 中,为什么 SFSafariViewController 被推送而不是模态呈现?

转载 作者:IT王子 更新时间:2023-10-29 07:48:11 25 4
gpt4 key购买 nike

我通过在 UIViewController 实例上调用 presentViewController:animated:completion: 来呈现一个 SFSafariViewController

结果是它被推送(从右边滑入),就好像我在 UINavigationController 上调用了 pushViewController:animated: > 实例。我已经证实这一切都发生在主队列上。并且呈现 View Controller 本身不是模态(这应该无关紧要,但为了以防万一,我们可以排除这种可能性)。

如果我将 SFSafariViewController 替换为 UIViewController,它会按预期工作,以模态方式呈现。

weakSelf.oAuthViewController = [[SFSafariViewController alloc] initWithURL:url];
[viewController presentViewController:weakSelf.oAuthViewController animated:YES completion:nil];

知道为什么或如何解决这个问题吗?

最佳答案

这是获得 SFSafariViewController 垂直模态显示的简单方法:

let safari = SFSafariViewController(URL: url)
safari.modalPresentationStyle = .overFullScreen
presentViewController(safari, animated: true, completion: nil)

关于ios - 在 iOS 9 中,为什么 SFSafariViewController 被推送而不是模态呈现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35629063/

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