ios - Swift 5 PopGesture 问题
问题描述
我对 interactivePopGestureRecognizer 有疑问。在我的应用程序中,当我在我的第一个视图控制器中做左滑动手势时(没有任何先前的屏幕),我的应用程序冻结了。当我查看调试面板时,看起来第二个视图控制器正在显示,但在卷轴设备中,它在第一个视图控制器中冻结。如果我向左滑动手势,我的应用程序就会恢复正常。
我一直在尝试该解决方案,但对我不起作用=>
我还将 UINavigationViewController,UITabbarNavigationViewController 插入到我的 BaseViewController
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if (navigationController.viewControllers.count > 1)
{
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
navigationController.interactivePopGestureRecognizer?.isEnabled = true;
}
else
{
self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
navigationController.interactivePopGestureRecognizer?.isEnabled = false;
}
}
面板屏幕的外观与这张照片中的相同。
解决方案
推荐阅读
- r - 总结多列并在R中按名称选择一列值
- python - 如何更改输入函数参数的类型?
- modelica - 如何更改 Modelica 包中的显示顺序?
- ag-grid - 在chrome 81版本中,设置ag-grid的gridOptions.defaultColDef.autoHeight = true,调用api.resetRowHeights时浏览器崩溃或卡住
- php - laravel auth()->attempt() 是否写入任何会话
- html-imports - 使用 webcomponents 后,HTML 导入在 Chrome 最新版本中不起作用
- php - 如何使用 jquery ajax 进行通知
- javascript - vue-test-utils - 如何处理 $refs?
- python - 提取python中三个星号之间的数据
- mysql - 大 INSERT 的性能与来自大量选择的数据