-
Notifications
You must be signed in to change notification settings - Fork 1.1k
【help】how can i resolve sticky tab view inside scrollview #411
Comments
Maybe the stickyHeaderIndices of ScrollView would give u a hand. However, you need render the tab header yourself in |
We arrive at the the same conclusion: i.e. dealing ourself with the tab header. I was expecting that using Is there a way to make |
Don't nest the TabView inside a ScrollView. The FlatList cannot optimize it's rendering when you do that. Listen to scroll events and apply translation to the tab bar to make it sticky. Example: https://snack.expo.io/@satya164/collapsible-header-with-tabview |
@satya164 How to set same offset when there are multiple page? |
@satya164 in the expo snack you mentioned above, once the header is collapsed and if we navigate to another tab, can see some whitespace on the tab, coz of padding being set. Any workaround to fix that issue? |
@satya164 now I came a nested tab view case. I have a animated scroll tab view like below above, and one of its tab have another tab view. The child tab view will sticky follow parent tab, I want to use scroll y to manual control scrollenabled, but it's very trouble, have any advice ? thanks sooo much~ |
after read react-native-tab-view source code, i know how to do it. |
@youhan26 I have the same issue, thank for any advice. |
@cobarx, I hoped to get working sample, tab header works only with one current tab. If you find working solution plz share with me. |
It seems to me TabViewAnimated is no longer exist. |
@ShabareeshSunku , @cobarx , @alpamys-qanybet , I also had that problem, here's what I did,
|
@satya164 How can I make it expands when scrolling top and collapses when scrolling down like this https://i.stack.imgur.com/CjAI4.gif? |
@bhagwantg I just got the similar problem, may I ask for your help? |
Can try: |
@bhagwantg, @satya164, Can anyone please help me with the sample code? I got the same problem. When one of the tab is scrolled, other tabs leave the white spaces (gap) on the top as much as the other tab is scrolled. |
any update on this? i believe sticky |
Managed to get a solution, not proud of it but it works. The flat list needs to be optimised https://gist.github.com/maitham/6e0841800d88bf9c289fc45bbc903b1d |
@maitham good but not perfect, buggy and sometimes tabs do not sync, any solutions or in case if you perfected this ? i really need to implement this behavior in my project |
Do we have any solutions for this? |
https://medium.com/@linjunghsuan/implementing-a-collapsible-header-with-react-native-tab-view-24f15a685e07 works perfectly and it easier to implement in your own project than the other working solution in this thread. |
Found a same issue, but not I want.
Expected behaviour
I have three flatlist using react-native-tab-view. And the tab view inside parent scrollview.
when the tab view is not scroll to header of screen, the parent scrollview will always scroll even if touch the tab view content.
But after the tab view scroll to header of screen, the child flatlist of tab view can scroll auto.
When drag down, the child flatlist will scroll first. And when child flatlist scroll to top, parent scrollview will start to scroll down.
Actual behaviour
none
Code sample, screenshots
none
What have you tried
I use
scrollEnabled
attribute to resolve this case. When tab view scroll to header of screen. Set parent scrollendabled false and child flatlist scrollendable true.It does work. But it always pause when tab view scroll to header or leave.
Because only one component can response panresponder event at the same time.
Any advice ? Thanks very much and pardon my poor English...
The text was updated successfully, but these errors were encountered: