问题
So I have looked over a bunch of other questions that could possible be duplicates. But none of the solutions that have been mentioned seem to work. Also, the answers tend to be scattered and incomplete.
So, I have a UIView inside of a subclassed UIScrollView. All I need to do is have the UIScrollview ignore all forms of gesture that can occur with 3 fingers and, instead, pass it on to the UIView inside. Could someone help me with this.
回答1:
You need to subclass the scrollview to accomplish this. I tested this technique with a UITableView just now and it worked.
@interface OneTwoTouchScrollView : UIScrollView
@end
@implementation OneTwoTouchScrollView
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)recognizer
{
return recognizer.numberOfTouches < 3 && [super gestureRecognizerShouldBegin:recognizer];
}
@end
来源:https://stackoverflow.com/questions/11758996/uiscrollview-ignoring-passing-on-3-touch