How to expand Flatlist on swipe up on React Native

1.1k Views Asked by At

Hi I’m a new developer that just graduated school so I’m working on a portfolio project. Sorry in advance if the question seems dumb.

I have a carousel showing a gallery of images at the top of my screen and a vertical flat list for the second (bottom) half.

How do I get the bottom half to take the full screen on swipe up and go back to half screen on swipe down? react-native-gesture-handler only offers swipeable left or right and not up and down.

1

There are 1 best solutions below

0
On BEST ANSWER

You need to play around with flex. Apply flex on parent view with value in between 0-1 and change it accordingly on swipe. To detect swipe in react native, follow link below

https://dev-yakuza.posstree.com/en/react-native/react-native-swipe-gestures/