|
|||
|
inherited a class from UIScrollView, according to doc,
(BOOL)touchesShouldBegin NSSet *)touches withEvent UIEvent *)event inContentView UIView *)view should be called when user tap the screen, but it never happens, anything wrong with the code?@interface Piano2View : UIScrollView { } @end @implementation Piano2View - (id)initWithFrame: (CGRect)frame { if (self = [super initWithFrame:frame]) { // Initialization code } return self; } //Overridden by subclasses to customize the default behavior when a finger touches down in displayed content. - (BOOL)touchesShouldBegin: (NSSet *)touches withEvent: (UIEvent *)event inContentView: (UIView *)view { UITouch* touch = [[event touchesForView:self] anyObject]; CGPoint location = [touch locationInView:self]; return YES; } |
![]() |
| Thread Tools | |
| Display Modes | |
|
|