Reputation: 747
I have text and image in one row. and now I want to put button over the row with exact size of row.
used flexDirection: 'row'
Any help?
Upvotes: 0
Views: 240
Reputation: 6668
You can wrap your text and image inside the TouchableOpacity
component
<TouchableOpacity onPress={() => doYourThing()}>
<Text>{yourText}</Text>
<Image source={{}} />
</TouchableOpacity>
If the text and image are already wrapped in a View
, you can just replace the View
component with the TouchableOpacity
component. It takes all the props which View
takes.
Upvotes: 1