React native prohibited gesture touch pointerEvents

A requirement is to be met FIG carousel with automatic play, the UED carousel to the bottom side of the added shadow gradient, as the red area.

 

 

 This will cause a problem, the hand touch View this layer will be blocked in the red region, resulted in a manual slide switch.

Originally taken off method is to perform in the corresponding return false touch event, but this limited view of the carousel assembly was the father of the red zone. Otherwise, touch not bubble up.

Found a nice property, I had never been used. pointerEvents 

Look at the introduction of the official website:

  Can be used to control whether the current view as a target of the touch event.

  • auto: the view can be the target of a touch event.
  • none: view not be the target of the touch event.
  • box-none: can not view itself as a touch event target, but its child views can

<View pointerEvents = 'none'></View>

Such can be the perfect solution to the conflict, and do not control what level direct question, what are bubbling capture ignored.

Guess you like

Origin www.cnblogs.com/hjj2ldq/p/11759834.html