In my app I have UIScrollView which has many UITableViews. In cells of this table there is UISlider. How I can disable touch forwarding if user make scroll gesture on table view? Now if user make scroll gesture near slider (but not on it) the touch event gets forwarder to scroll view.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can subclass UIScrollView and add this method to the new class
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *result = [super hitTest:point withEvent:event] ;
self.scrollEnabled = ![result isKindOfClass:[UISlider class]] ;
return result ;
}