UIScrollView无法响应touches的解决方法

自定义一个类继承UIScrollView,将touchesEnded事件发送出去。

 

#import <Foundation/Foundation.h>


@interface PageScrollView : UIScrollView {

}

@end
#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

 

posted @ 2010-10-14 16:29  王喆(nasa)  阅读(2830)  评论(0编辑  收藏  举报