touchesBegan not called in UIView subclass

前端 未结 2 2043
一个人的身影
一个人的身影 2021-01-17 18:54

I know there already are some questions about this but I couldn\'t find a solution. There is a very simple code that works just fine on one of my projects but not on an anot

相关标签:
2条回答
  • 2021-01-17 19:19

    You need to make sure that userInteractionEnabled is enabled on all of the superviews of your view. If any of the superviews have this property set to false, the touch events won't be processed for them or any of their subviews.

    0 讨论(0)
  • 2021-01-17 19:23

    Maybe some of the superviews has the userInteractionEnabled set to "false"?

    0 讨论(0)
提交回复
热议问题