PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
869 stars 171 forks source link

Is there any way to detect when the header is moved up all the way? #251

Open jm90m opened 2 years ago

jm90m commented 2 years ago

Hello, I want to be able to detect if the header has gone up all the way, meaning the user has scrolled far enough down that the header has collapsed.. Is there any way to detect this?

tiagocorreiaalmeida commented 2 years ago

@jm90m you can use the useHeaderMeasurements hook, that gets you the headerTranslateY and header height https://github.com/PedroBern/react-native-collapsible-tab-view/blob/1571a625eb3a2527acd3ba9a9267fb939b330a51/src/hooks.tsx#L580 from those you can easily check if the header is collapsed, you might to take into consideration the minHeaderHeight if you are using such prop

jm90m commented 2 years ago

thanks, was having issues with this library so I created my own header collapsible tab view