您的位置:首页 > 产品设计 > UI/UE

uiscrollview uicollectionview touch事件传递问题

2015-06-16 12:06 471 查看
uiscrollview uicollectionview 无法响应touch事件,解决方案,新建一个uiscrollview 的category

@implementation UIScrollView (UITouch)

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

//if(!self.dragging)

{

[[self nextResponder] touchesBegan:touches withEvent:event];

}

[super touchesBegan:touches withEvent:event];

}

-(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];

}

@end

uicollectionview 是继承uiscrollview,所以 也可以用此category,来截获touch事件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: