Reputation: 534
I want to register three gestures in one container of the view:
My current implementation uses PanHandler to register the gesture and uses TouchableOpacity to reduce the Opacity when card is being swiped.
But I'm not sure how to implement those three above gestures for the same exact card.
Upvotes: 2
Views: 4065
Reputation: 532
You can just use a <TouchableHighlight />
(or any other 'Touchable' component) nested inside of a <Swipeable />
component (typically implemented using the react-native-swipeable library).
So something like the following:
{/* Props are not set in this example for simplicity */}
<Swipeable>
{/* You should of course nest some components in the next element if you want to */}
<TouchableHighlight />
</Swipeable>
I fixed it like this myself.
By the way: Nesting the elements the other way around (like so <TouchableHighlight><Swipeable /></TouchableHighlight>
) gave me a lot of issues, so I don't recommend doing that.
Upvotes: 1