您将要使用 UIScrollViewDelegate,它具有以下方法:
– scrollViewDidScroll:
– scrollViewWillBeginDragging:
– scrollViewWillEndDragging:withVelocity:targetContentOffset:
– scrollViewDidEndDragging:willDecelerate:
– scrollViewShouldScrollToTop:
– scrollViewDidScrollToTop:
– scrollViewWillBeginDecelerating:
– scrollViewDidEndDecelerating:
将 UITableViewController 委托的“scrollView.delegate”属性设置为“self”并在将 UIScrollViewDelegate 添加到表视图控制器后执行以下操作(您甚至可能不需要这样做,我不记得了,但它可能已经自动完成,您只需要公开这些方法)。
– scrollViewWillBeginDragging:
-> take your webview and "yourWebview setUserInteractionEnabled:NO"
– scrollViewWillEndDragging:withVelocity:targetContentOffset:
-> take your webview and "yourWebview setUserInteractionEnabled:YES"
这只是一种方法。另一个可能是使用 UIGestureRecognizerDelegate 并尝试使用“–gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:”