Closed LBBanner closed 7 years ago
看了下代码
(BOOL)touchesShouldCancelInContentView:(UIView *)view { if ( [view isKindOfClass:[UIButton class]] ) { return YES; }
return [super touchesShouldCancelInContentView:view]; } 这么处理的,但是感觉还是延迟。
另外查了下,有些是这么处理的 //传递touch事件
(void)touchesBegan:(NSSet)touches withEvent:(UIEvent)event { if(!self.dragging)
{ [[self nextResponder] touchesBegan:touches withEvent:event]; }
[super touchesBegan:touches withEvent:event];
// NSLog(@"MyScrollView touch Began"); }
(void)touchesMoved:(NSSet )touches withEvent:(UIEvent )event { if(!self.dragging) { [[self nextResponder] touchesMoved:touches withEvent:event]; } [super touchesMoved:touches withEvent:event]; }
(void)touchesEnded:(NSSet)touches withEvent:(UIEvent)event { if(!self.dragging) { [[self nextResponder] touchesEnded:touches withEvent:event]; } [super touchesEnded:touches withEvent:event]; }
但是还是不行,之前没有做过这种类似的需求,请问这个是不是属于bug,或者有什么好办法吗?
@LBBanner 我测试了下,这个应该不属于BUG,可以这么理解,tableview在正常的上下滑动中,你点击Cell一样没有效果,要滑动停止后才能相应你的Select事件,所以我个人觉得这个不是BUG。
看了下代码
(BOOL)touchesShouldCancelInContentView:(UIView *)view { if ( [view isKindOfClass:[UIButton class]] ) { return YES; }
return [super touchesShouldCancelInContentView:view]; } 这么处理的,但是感觉还是延迟。
另外查了下,有些是这么处理的 //传递touch事件
(void)touchesBegan:(NSSet)touches withEvent:(UIEvent)event { if(!self.dragging)
{ [[self nextResponder] touchesBegan:touches withEvent:event]; }
[super touchesBegan:touches withEvent:event];
// NSLog(@"MyScrollView touch Began"); }
(void)touchesMoved:(NSSet )touches withEvent:(UIEvent )event { if(!self.dragging) { [[self nextResponder] touchesMoved:touches withEvent:event]; } [super touchesMoved:touches withEvent:event]; }
(void)touchesEnded:(NSSet)touches withEvent:(UIEvent)event { if(!self.dragging) { [[self nextResponder] touchesEnded:touches withEvent:event]; } [super touchesEnded:touches withEvent:event]; }
但是还是不行,之前没有做过这种类似的需求,请问这个是不是属于bug,或者有什么好办法吗?