Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show header when scroll up and hide header when scroll down on FlatList

Now I want to create, exactly like Facebook's app do, a bar displayed above my tabNavigator. This tabs hide on scroll down and show on scroll up. And now I'm using FlatList, but the FlatList component has ListHeaderComponent option for rendering his header who also hide when scrolling down. (because it is on top, so need to scroll to beginning to see it, not user-friendly with my very long list item )

Please help me any idea.

like image 520
ninh_nguyen Avatar asked Dec 22 '18 03:12

ninh_nguyen


People also ask

How do you hide the scroll indicator in FlatList?

to add a FlatList with the showsVerticalScrollIndicator and showsHorizontalScrollIndicator props set to false to hide the vertical and horizontal scrollbar respectively.

Which is better FlatList or ScrollView?

ScrollView renders all its react child components at once, but this has a performance downside. FlatList renders items lazily, when they are about to appear, and removes items that scroll way off-screen to save memory and processing time.


1 Answers

Flat list provide you a header and footer of it self. You have to make it manually. I found one link which is related to collapsible navbar.

https://medium.com/appandflow/react-native-collapsible-navbar-e51a049b560a

https://expo.io/@janic/collapsible-navbar this lnk has a demo. so you can check it out here

might this helpful !

like image 67
Shashin Bhayani Avatar answered Oct 14 '22 15:10

Shashin Bhayani