Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set userInteractionEnabled false in react native

Tags:

react-native

Is there a way to set userInteractionEnabled false on the Image component in RN?

Asking it because need to implement the design below. There is a blur overlay on the right side. We want the text under it still can handle click, so need set the blur image userInteractionEnabled false.

enter image description here

like image 499
Yujun Wu Avatar asked Mar 17 '16 18:03

Yujun Wu


2 Answers

is very easy.

<View accessible={false} pointerEvents='none'>

like image 59
jose920405 Avatar answered Nov 07 '22 10:11

jose920405


The equivalent of userInteractionEnabled in react-native is the touchEvents prop for views.

You can set it to "none" on your Image and it will not intercept touches anymore. http://facebook.github.io/react-native/docs/view.html#pointerevents

like image 45
Janic Duplessis Avatar answered Nov 07 '22 09:11

Janic Duplessis