我有一个子视图和一个超级视图。超级视图附加了一个 UITapGestureRecognizer。
UIView *superview = [[UIView alloc] initWithFrame:CGRectMake:(0, 0, 320, 480);
UIView *subview = [[UIView alloc] initWithFrame:CGRectMake:(100, 100, 100, 100);
UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget: self action: @selector(handleTap);
superview.userInteractionEnabled = YES;
subview.userInteractionEnabled = NO;
[superview addGestureRecognizer:recognizer];
[self addSubview:superview];
[superview addSubview:subview];
识别器也在子视图内触发,有没有办法从子视图中排除识别器?
我知道以前有人问过这个问题,但我没有找到一个好的答案。