拖动子视图时防止UIScrollView滚动

我有UIScrollView内的分页与UIButton。 我已经实施

UIControlEventTouchDragInside

[transButton addTarget:self action:@selector(dragMoving:withEvent:) forControlEvents: UIControlEventTouchDragInside];

该按钮的事件。 有时拖动按钮时,滚动视图会滚动到下一页。

如何防止在拖动UIButton时滚动视图检测到滑动事件?

谢谢。


从文档中,使用requireGestureRecognizerToFail:

[[scrollView panGestureRecognizer] requireGestureRecognizerToFail:yourSwipeGestureRecognizer];
链接地址: http://www.djcxy.com/p/40537.html

上一篇: Prevent UIScrollView scrolling while subview is dragged

下一篇: How to detect "Drag Enter" on UIScrollView