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

将UIScrollView点击点击事件传递到父View

2016-02-24 16:15 239 查看
直接上代码:

#import <UIKit/UIKit.h>

@interface CTScrollView :
UIScrollView

@end

#import "CTScrollView.h"

@implementation CTScrollView

/*

// Only override drawRect: if you perform custom drawing.

// An empty implementation adversely affects performance during animation.

- (void)drawRect:(CGRect)rect {

    // Drawing code

}

*/

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

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

    [super touchesBegan:touches
withEvent:event];

}

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

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

    [super touchesMoved:touches
withEvent:event];

}

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

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

    [super touchesEnded:touches
withEvent:event];

}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Touch事件传递