The name is complicated. The main case is this:
UIView *superView = [[UIView alloc] initWithFrame:CGRectMake(0,0,400,400)]; UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(-200,-200,400,400)]; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; [subView addGestureRecognizer:tapGesture]; [superView addSubView:subView];
OK, you will find that the touch gesture will work when you press the area at (0,0,200,200), if you press the point (-150, -150), the touch gesture will not take effect.
I do not know if a click outside the supervisor can cause this problem or not.
Does anyone know how to fix this?
source share