
- React Native Tutorial
- React Native - Home
- Core Concepts
- React Native - Overview
- React Native - Environment Setup
- React Native - App
- React Native - State
- React Native - Props
- React Native - Styling
- React Native - Flexbox
- React Native - ListView
- React Native - Text Input
- React Native - ScrollView
- React Native - Images
- React Native - HTTP
- React Native - Buttons
- React Native - Animations
- React Native - Debugging
- React Native - Router
- React Native - Running IOS
- React Native - Running Android
- Components and APIs
- React Native - View
- React Native - WebView
- React Native - Modal
- React Native - ActivityIndicator
- React Native - Picker
- React Native - Status Bar
- React Native - Switch
- React Native - Text
- React Native - Alert
- React Native - Geolocation
- React Native - AsyncStorage
- React Native Useful Resources
- React Native - Quick Guide
- React Native - Useful Resources
- React Native - Discussion
React Native - Touches
In this chapter we will show you touchable components in react Native. We are calling them 'touchable' because they offer built in animations and we can use onPress prop for handling touch event.
Touchable Highlight
When user press the element, it will get darker.
Example
<TouchableHighlight> <Text> Button </Text> </TouchableHighlight>
Touchable Opacity
This element will change opacity of an element when touched.
Example
<TouchableOpacity> <Text> Button </Text> </TouchableOpacity>
Touchable Native Feedback
This will simulate ink animation when element is pressed.
Example
<TouchableNativeFeedback> <Text> Button </Text> </TouchableNativeFeedback>
Touchable Without Feedback
This should be used when you want to handle touch event without any animation.
Example
<TouchableWithoutFeedback> <Text> Button </Text> </TouchableWithoutFeedback>
Advertisements