mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3.1 KiB
3.1 KiB
id, title, original_id
| id | title | original_id |
|---|---|---|
| version-0.24-touchableopacity | touchableopacity | touchableopacity |
TouchableOpacity # | Edit on GitHub |
A wrapper for making views respond properly to touches. On press down, the opacity of the wrapped view is decreased, dimming it. This is done without actually changing the view hierarchy, and in general is easy to add to an app without weird side-effects.
Example:
renderButton: function() {
return (
<TouchableOpacity onPress={this._onPressButton}>
<Image
style={styles.button}
source={require('image!myButton')}
/>
</TouchableOpacity>
);
},
Props #
activeOpacity number #
Determines what the opacity of the wrapped view should be when touch is active.