UIView -> UIImageView
I know I have things somewhat working ok since I can tap on my UIImageView
and see an NSLog()
statement in my touchesBegan
method.
.
UIView -> UIScrollView -> UIImageView
I drag that same UIImageView
into a UIScrollView
and touchesBegan
no longer gets called when I tap on my UIImageView
. (I haven't changed anything else. All the same connections, methods, and code remains unchanged.)
Why does touchesBegan
no longer work? And what can I do to get it working again?
Add uitapgesture to get event
Code is
UITapGestureRecognizer *ges11=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(Handeltap:)];
[imagename addGestureRecognizer:ges11];
Create one action name "Handeltap" U will get called there.
by default UIImageView
don't handle user gestures.
set UIImageView
instance's userInteractionEnabled
to YES
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With