-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Embedding react-native-tab-view in scrollview is not working #1274
Comments
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Trying to get this to work has consumed my entire day. Please, let me know if anyone finds a solution to this. I am now considering react-native-collapsible-tab-view which seems to work in scrollview but it is not as popular as this |
@TeyimPila Thanks for the response. But react-native-collapsible-tab-view animations are not smooth as this. Another option could be react-native-scrollable-tab-view |
I was able to find a hack for this. I achieved it by giving the TabView style prop a height. The problem with this is that the hight is fixed and thus not suitable for variable-length content |
@TeyimPila Thanks, man. This works like magic |
thanks @TeyimPila |
any updates on this? |
we have dynamic content inside the tabs. it was working in v2. but the height shrinks to 0 with v3. would greatly appreciate any workaround that allows for variable-height content. |
Any update? |
change style ={{flex:1}} inside scrollview to contentContainerStyle={{flex:1}} hope useful to you! |
If anyone want to make a tabview with scrollview when there is more than three tabs please enable scroll in tabbar.it made my tabview scrollable.i have followed below code |
Any update? |
@IzaELK Please, have you found a solution to this |
@turhansel the issue is about having TabView inside ScrollView. not the other way around. |
On our side we decided to use patch-package to apply those changes until they are validated/merged. For us it works like a charm. We had the same usecase as @IzaELK :) |
@Gguigre I applied the patch and found that we also needed to revert a recent |
I can't seem to get it working using above pull request. I use the tab view inside a screen of react-navigation/native which forces me to use a { flex: 1 } on the contentContainerStyle of the ScrollView |
Closing as it is a duplicate of #1349 which is resolved. |
It is not resolved yet, the same as #1349. |
After days of trying to find a solution, I decided to settle with react-native-collapsible-tab-view. |
Migrating react-navigation and updating react-native-tab-view from 2.16.0 to 3.3.0 causes this problem. |
Current behavior
It perfectly works fine with non scrollable views. But when it is wrapped inside Scrollview, tabview route contents disappearing. But it is already mentioned in Readme as - 'Avoid rendering TabView inside ScrollView' and 'So avoid doing it if possible'. My question is it possible to wrap it in Scrollview like this,
<ScrollView style={styles.scrollView}> <View style={{flex: 1}}> <TabView renderTabBar={renderTabBar} navigationState={{index, routes}} renderScene={renderScene} onIndexChange={setIndex} initialLayout={initialLayout}/> </View> </ScrollView>
Expected behavior
To be able to run inside Scrollview
Reproduction
https://snack.expo.dev/kv0RZ0qCK
Platform
Environment
The text was updated successfully, but these errors were encountered: