alexbrillant / react-native-deck-swiper

tinder like react-native deck swiper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScrollView is not working inside the Swiper.

kalyanijamunkar10 opened this issue · comments

@alexbrillant Is there any way to enable scroll inside the card swiper?

@kalyanijamunkar10 I suggest you look into Swiper.js and find the reason for it :)

but why do you have the scroll view inside the card?

It worked when i used <Animated.ScrollView>

i think the issue is actually that the renderOverlayLabel has a width and height of 100% and a flex:1 with absolute position so it is covering the scrollview.. the 'like' and 'nope' is covering the scrollview. at least that is part of the issue. in swiper.js

If anyone is still having this issue, here is the latest solution in January 2022:

You have to cover the child or childern of the View inside your 'renderCard' with a 'ScrollView' and a TouchableOpacity. See the section of the code below:

....
renderCard = (cards, index) => {
return (

  <View style={styles.card}>

  <ScrollView>
  <TouchableOpacity>

   <Text> {cards} </Text>

   </TouchableOpacity>
   </ScrollView>

  </View>
)

};
....

Remember to disable vertical scrolling first using verticalSwipe={false} if you wish.

Also, to reduce the opacity change on when you scroll, use the activeOpacity prop to manually edit this, like: : <TouchableOpacity activeOpacity={.7}>