UIButton inside UIImageView does not respond to taps

后端 未结 3 762
走了就别回头了
走了就别回头了 2020-12-29 20:18

I have a scroll view, which has an image view with an image as a subview, and the image view has a UIButton as one of its subviews. The problem is, I am not abl

3条回答
  •  再見小時候
    2020-12-29 20:33

    UIImageView has userInteractionEnabled set to NO/ false by default.

    You are adding the button as a subview to the image view. You should set it to YES / true.

提交回复
热议问题