自定义一个类继承UIScrollView,将touchesEnded事件发送出去。
代码语言:javascript复制#import <Foundation/Foundation.h>
@interface PageScrollView : UIScrollView {
}
@end
代码语言:javascript复制#import "PageScrollView.h"
@implementation PageScrollView
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event {
if (!self.dragging) {
[self.nextResponder touchesEnded: touches withEvent:event];
}
[super touchesEnded: touches withEvent: event];
}
@end