我有一个 UIView 和一个点击手势识别器:
UIImageView *tabView = [[UIImageView alloc] initWithFrame:CGRectMake(41, 145, 702, 100)];
tabView.image = [UIImage imageNamed:@"inactive_tab"];
tabView.userInteractionEnabled = YES;
UITapGestureRecognizer *singleFingerTap =
[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(handleSingleTap:)];
[tabView addGestureRecognizer:singleFingerTap];
[self.scrollView addSubview:tabView];
我在滚动视图上添加了另一个视图:
[self.scrollView addSubview:self.activeTab];
activeTab 在 inactiveTap 之上。当我点击 activeTap 时,手势识别器会触发,我不想发生这种情况。我怎样才能避免这种情况?