I want to catch the event when a user taps on the view. Currently, I use the TouchableXXX
components to catch user onPress
(seems like onPress
catches the onTapDown
event only).
标签:
react-native
相关问题
- React Native Inline style for multiple Text in sin
- How Do I Convert Image URI into Byte Expo
- ApolloClient from apollo-boost attemped to assign
- Implementing ssl pinning in a react-native applica
- React-Native: Enable Performance Monitor in produc
相关文章
- Why do we have to call `.done()` at the end of a p
- Remove expo from react native
- React Native - Dynamic Image Source
- “Unfortunately, app has stopped” error with buildi
- eslint Parsing error: Unexpected token =
- How to determine JS bottlenecks in React Native co
- How to override navigation options in functional c
- PanResponder snaps Animated.View back to original
The accepted answer does not work anymore. The correct way is to use Touchable's onPressIn()
https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#onpressin
You can set
onTouchStart
andonTouchEnd
handlers on anyView
via props, for example:<View onTouchStart={() => this.doSomething()} />
For general information about RN touches see the Handling Touches guide. In case you need a more complex, or custom touch handling, see the Gesture Responder System guide.