开发者

detect touchesEnded in a scrollview

so I have a scroll vie开发者_Python百科w and what I would like is that when I end my touch (touchesEnded) in this scroll view : (do something) but it doesn't detect my touchesended I don't know why. How can I solve this please .sorry for my english I'm french :/


Subclass uiScrollview like this and it should work: In .h file:

@interface MyScrollView : UIScrollView {
}

@end

In .m file:

@implementation MyScrollView

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜