gpt4 book ai didi

iOS 6 UIGestures(滑动)停止使用 QLPreviewController

转载 作者:可可西里 更新时间:2023-11-01 03:13:39 25 4
gpt4 key购买 nike

在 iOS 6 beta 4 和 iOS 5.1.1 中,我有左/右滑动功能,允许用户在托管在 UIViewController 中的不同 QLPreviewController 之间滑动。

在 iOS 6 的发布版本中,滑动现在被完全忽略了。

尝试将 UIView 作为预览 Controller 的 subview ,以试图让托管预览 Controller 的 View 在预览 Controller 有机会吞下滑动之前拦截它们,但这些从未被触发。

任何人都看过这个或知道解决方法。

谢谢,

最佳答案

我遇到了同样的问题,但 UITapGestureRecognizer 无法在 QLPreviewController 上运行。在 iOS 6 中,这个东西就像 UIGestureRecognizer 对象的黑洞……没有任何东西可以从那里出来!

不过我确实找到了解决方法。我是 QLPreviewController 的子类,所以在我的子类中我滥用了(相对)新的 viewWillLayoutSubviews 方法并添加了以下代码片段:

UIView *overlay = [[UIView alloc] initWithFrame:self.view.frame];
overlay.backgroundColor = [UIColor whiteColor];
overlay.alpha = .002f;
for (UIView *v in self.view.subviews)
{
[v addSubview:overlay];
}
[overlay release];

这可能有点矫枉过正,但我​​基本上进入了所有快速查看 subview 并向它们添加了一个可以接受手势的 View 。我选择了 .002 alpha,因为降低它会导致手势再次被忽略。

关于iOS 6 UIGestures(滑动)停止使用 QLPreviewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12530859/

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