Cell不接收触摸事件。有没有办法取消UIScrollView的点击事件(只需要处理滚动)?
答案 0 :(得分:5)
如果需要接触,请实现UIScrollView的子类,并添加以下内容:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
// Pass to parent
[super touchesBegan:touches withEvent:event];
[self.nextResponder touchesBegan:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
// Pass to parent
[super touchesEnded:touches withEvent:event];
[self.nextResponder touchesEnded:touches withEvent:event];
}
单元格只接受点击,所以它会起作用。
答案 1 :(得分:0)
这太棒了!我正在拉这个头发。