`
ypf3027
  • 浏览: 304277 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

UIScrollView touches事件不响应解决

    博客分类:
  • iOS
 
阅读更多

//重写UIScrollView的以下三个方法,通过“类别”扩展或是继承自UIScrollView自定义类实现。

 

- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
    [super touchesBegan:touches withEvent:
event];
    
if ( !self.dragging )
    {
        [[self nextResponder] touchesBegan:touches withEvent:
event];
    }
}
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
    [super touchesMoved:touches withEvent:
event];
    
if ( !self.dragging )
    {
        [[self nextResponder] touchesMoved:touches withEvent:
event];
    }
}
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
{
    [super touchesEnded:touches withEvent:
event];
    
if ( !self.dragging )
    {
        [[self nextResponder] touchesEnded:touches withEvent:
event];
    }
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics