2012-07-20 94 views
0

我有UIButton和UIView,我加載按鈕(如setImage) 如何從UIView中刪除識別器,以便我可以按下UIButton,而不是UIView?如何從UIView中刪除識別器

+1

'[self.view removeGestureRecognizer:yourRecognizer]刪除所有單個輕敲姿勢在您的視圖;' – iNoob 2012-07-20 12:23:22

回答

2
for(UIGestureRecognizer *gesture in [self.view gestureRecognizers])){ 
      if([gesture isKindOfClass:[UITapGestureRecognizer class]){ 
      if (gesture.numberOfTapsRequired == 1) 
       [imageView removeGestureRecognizer:gesture]; 
      } 
     } 

您可以使用此