Search code examples
iphoneuiimageviewuibutton

Button not responding to touch


In my application I added a UIImageview to a UIView and a UIButton added to that UIImageView. That button is not responding to touch events and the action selector is not called. Why?


Solution

  • Because UIImageView has its userInteractionEnabled property set to NO by default. Set it to YES.