开发者

how to create a IB action for a image view

i have a image ,i want to launch url when i p开发者_StackOverflow社区ress that logo or image ,how to implement ib action for that image view ... can any one give suggestion i selected image view in ib to place my logo is it right?


UIImageView is not a subclass of UIControl so it doesn't support the target-action mechanism. You have 2 options:

  1. Use a UIButton instead (and set your image as the button's background image).
  2. Set userInteractionEnabled = YES; on your image view and implement the touch handling in -touchesMoved:` etc. yourself.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜