iOS - 双击手势不能在UIWebView上运行

时间:2012-10-17 15:22:17

标签: objective-c cocoa-touch uiview uiwebview swipe-gesture

我有viewController以编程方式添加了几个项目。 UILabelUIWebView包含滚动视图。

现在我已经使用storyboard在viewController上添加了一个滑动手势,当运行时似乎没问题。

问题出现在我尝试滑动UIWebview时,它不会触发滑动手势,看起来好像取消了它。

如何启用它以使手势在整个视图上运行但仍保留UIWebview功能?

1 个答案:

答案 0 :(得分:0)

你可以设置 [UIWebView.scrollView setDelegate:myViewController] 并在视图控制器中实现 - (void)scrollViewDidScroll:(UIScrollView *)sender

但要真正传递事件,你需要更多: http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/