Get Touch Event on entire screen
To elaborate @Nicholas Chong advice, here is the example that works for me fine. You can use onTouchStart
and onTouchEnd
handlers on any View
via props:
<View
onTouchStart={() => doSomething()}
style={{ width: '100%', height: '100%' }}
/>
More information
onResponderGrant not working for me, and I use onTouchEnd to trigger when tap the screen, this will work
You do not need to warp it with Touchable
component.
Add next props to root View
.
onResponderGrant - make View
handle touch
onStartShouldSetResponder - make View
handle start