ios - 在点击通知时弹出弹出问题(深度链接)
问题描述
我已经在屏幕上展示了一个控制器,现在单击主页按钮。然后我需要在使用深度链接点击通知后展示另一个控制器。当应用程序进入前台时,新的控制器也不会出现,之前的控制器也会被解散。也低于警告:-
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 从 custom 更改为 overCurrentContext 来解决它。
controller.transitioningDelegate = myDelegateForTransition
controller.modalPresentationStyle = .overCurrentContext
controller.modalPresentationCapturesStatusBarAppearance = true
viewControllerFromPresent.present(controller, animated: true, completion: {
completionHandler?()
})
推荐阅读
- css - 不可见的复选框、单选和输入大纲 CSS 问题还是什么?
- file - 在applescript中检测文件大小
- java - 如何在一个活动中扩展两个类?
- javascript - React Router Redirect 不渲染组件
- gruntjs - 警告:[object Object] 不是 PostCSS 插件。带有自动前缀的 GruntJS
- python - 当我在 url ...abc/pqr 并单击 xyz 时,django url 出现问题,而不是进入 ...xyz 但 ...abc/xyz
- reactjs - 警告:组件正在将受控输入更改为不受控
- javascript - 如何在 django 中使用 clean 方法编写条件验证?
- r - 将每日数据转换为每周数据并汇总 R 中的多个列
- c++ - 将字符串中的值分配给数组或变量