Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 UIButton 和 UIView,我在按钮上加载(如 setImage) 如何从 UIView 中删除识别器,以便我可以按下 UIButton,而不是 UIView?
for(UIGestureRecognizer *gesture in [self.view gestureRecognizers])){ if([gesture isKindOfClass:[UITapGestureRecognizer class]){ if (gesture.numberOfTapsRequired == 1) [imageView removeGestureRecognizer:gesture]; } }
您可以使用此删除视图中的所有单个点击手势