touchesBegan not called in UIView subclass

前端 未结 2 2046
一个人的身影
一个人的身影 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.

提交回复
热议问题