利用手势的代理方法可以很好的解决.
手势的协议 UIGestureRecognizerDelegate
代码
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if ([touch.view isKindOfClass:[UIButton class]])
{
return NO;
}
return YES;
}