UIScrollView解决touchesBegan等方法不能触发的解方案

新建一个类继承自UIScrollView  并重写下面的方法

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

[super touchesBegan:touches withEvent:event];

if ( !self.dragging )

{

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

}

}

-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{

[super touchesEnded:touches withEvent:event];

if ( !self.dragging )

{

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

}

}

上一篇:兼容ie7、8、9、10、FF、Chrome的遮罩显示


下一篇:CSS常用字体属性(多出的文本隐藏,或者以省略号的形式显示)和背景样式以及背景图的2个不常用属性:background-origin和background-clip