gpt4 book ai didi

ios - 点击通知时出现弹出窗口问题(Deeplink)

转载 作者:行者123 更新时间:2023-11-30 11:17:27 25 4
gpt4 key购买 nike

我已经在屏幕上显示了一个 Controller ,现在单击主页按钮。然后,在使用深层链接点击通知后,我需要在其上呈现另一个 Controller 。当应用程序进入前台时,新的 Controller 不会出现,并且以前的 Controller 也会被关闭。也低于警告:-

Attempt to present <NewController> on <PreviousController> whose view is not in the window hierarchy!

我使用下面的代码来演示。

controller.transitioningDelegate = myDelegateForTransition
controller.modalPresentationStyle = .custom
controller.modalPresentationCapturesStatusBarAppearance = true
viewControllerFromPresent.present(controller, animated: true, completion: {
completionHandler?()
})

最佳答案

我通过将controller.modalPresentationStyle从自定义更改为overCurrentContext解决了这个问题。

controller.transitioningDelegate = myDelegateForTransition
controller.modalPresentationStyle = .overCurrentContext
controller.modalPresentationCapturesStatusBarAppearance = true
viewControllerFromPresent.present(controller, animated: true, completion: {
completionHandler?()
})

关于ios - 点击通知时出现弹出窗口问题(Deeplink),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51606967/

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