开发者

Why doesn't my UIImageView respond to taps?

I have a UIImageView that's being loaded from a NIB. I've hooked up a gesture recognizer to it to开发者_开发知识库 handle taps, but when I run the app, taps aren't being detected.


You need to set the userInteractionEnabled property to YES. It's NO by default. You can either set it in the NIB by checking "User Interaction Enabled" in the Attributes Inspector pane, or set it programmatically after the NIB is loaded by setting the userInteractionEnabled property on the UIImageView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜