【发布时间】:2015-03-08 02:26:14
【问题描述】:
我有一个仅限 iPhone 的应用程序,它使用 UIScreenEdgePanGestureRecognizer 在 UINavigationController 中实现自定义交互式转换。在 UINavigationController 子类的 viewDidLoad 中创建并添加手势识别器如下:
UIScreenEdgePanGestureRecognizer* edgeRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
edgeRecognizer.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:edgeRecognizer];
当应用程序在 iPad 上运行时,当我尝试滑动以从导航堆栈中弹出视图控制器时,应用程序中没有任何反应,并且如果我在位置左侧开始手势,我会得到以下控制台输出应用程序窗口是:
_UIApplicationHandleEventFromQueueEvent 中出现意外的 nil 窗口, _windowServerHitTestWindow: ;层=>
有谁知道这个问题的原因以及我如何/是否可以解决这个问题?到目前为止,我在文档中找不到任何表明边缘平移手势不应在兼容模式下运行的内容。我正在 iOS 8 中进行测试。
手势在模拟器中有效,但在设备上无效。
【问题讨论】:
-
嘿,Darren,你有没有想过如何让 UIScreenEdgePanGestureRecognizer 为在 iPad 上运行的 iPhone 应用程序触发?即使在为 iOS 14 构建的 Xcode 12.4 中,它仍然对我不起作用……很想知道您是否找到了解决方法!谢谢!
标签: ios uinavigationcontroller uigesturerecognizer