Jump to content

UITouch not working for UIImageView


10 posts in this topic

Recommended Posts

How can a touchesBegan method working for UIImageView?

 

inside touchesBegan

 

UITouch *touch = [[event allTouches] anyObject];

if([touch view] == imageView){

NSLog(@"touch imageView");

}

 

the imageView is a UIImageView, UITouch can't work when I touch the imageView.

 

Please Help!

Link to comment
Share on other sites

Instead of the touchesBegan method, use the touchesMoved method. I think that should work.

I had try it and that's not work.

 

I think UITouch view method is only working with UIView instant.

 

Is there any other way to detect a UIImageView instant with UITouch method?

Link to comment
Share on other sites

Find out the solution

 

New image view objects are configured to disregard user events by default. If you want to handle events in a custom subclass of UIImageView, you must explicitly change the value of the userInteractionEnabled property to YES after initializing the object.

Link to comment
Share on other sites

 Share

×
×
  • Create New...