layer hit test only returning layer when bottom half of layer is touched

后端 未结 8 2153
闹比i
闹比i 2021-02-10 19:14

I have a sublayer on a layer-backed view. The sublayer\'s contents are set to an Image Ref and is a 25x25 rect.
I perform a hit test on the super layer when the touchesBega

8条回答
  •  我在风中等你
    2021-02-10 19:17

    If touches are being recognized on the lower part only, one possibility is that another subview is covering the top half of this subview. Do you have multiple subviews or only one image? In case you have multiple subviews and any of them have the background color as clearColor, try giving a solid background color to it for testing. That ways you'll know if your subview is getting covered by another subview or not.

    Hope that helps.

提交回复
热议问题