-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work in a ScrollView #187
Comments
Could you please attach your code only part with |
@skv-headless sure!
The code above doesn't render the child elements (ItemSegment and SkillSegment) But when I add contentContainerStyle={{flex:1}} to the parent ScrollView; it renders the child elements but it allows to scroll only inside the tab view, not whole parent view. |
I'm facing the same issue. Doesn't render child element |
Encountered this issue in Android. Works well on iOS. In android, if you press the tab long enough, only then, the tabs will switch. Nevertheless the tab content is not rendered in my case. No such issue in iOS |
Hi any updates on this one? I'm getting the same error. |
Don't work in android, the child components don't render... on iOS no problem |
Same issue on react native 0.26.2 and latest install of scrollable tab view. As comments above we can get the contents to show on Android with either using a View that then won't scroll as needed, or by adding ContainerStyle={{flex:1}} to ScrollView which also stops the scroll. Any update on a possible fix? |
I've got the same problem on React native 0.26.2 and the 0.4.4 version of react-native-scrollable-tab-view. |
same here |
related? facebook/react-native#4775 |
Is there any update on this issue? I'm running into the same problem. |
same prob on react-native 0.29 |
@skv-headless do you have any idea what the problem might be ? It's still happening on 0.30 Is it facebook/react-native#4775 really ? |
RN 0.31 brings this change, hopefully it solves the nested issue |
I'm using it with this Parallax scroll view and I'm having the same issue, child doesn't render and I can't scroll between tabs… Great work, I hope this can be solved. Thanks. |
It still doesn't work in 0.31 (Android) :( As soon as you nest the ScrollableTabView inside a View/ScrollView, the tab contents are not shown. It doesn't make a difference if you (This is on a fresh react-native init)
|
Well, it's not a react-native-scrollable-tab-view issue. It's definitely a ViewPagerAndroid issue. The example below won't work as soon as the ViewPagerAndroid is nested.
|
I got it working with the following code class Page extends Component {
render() {
return (
<View style={{flex: 1, backgroundColor: 'blue'}}>
<Text>{this.props.name}</Text>
</View>
)
}
}
class app extends Component {
render() {
return (
<ScrollView
contentContainerStyle={{flex: 1}}
>
<View style={{flex: 1}}>
<ScrollableTabView>
<Page name='tab1' tabLabel='tab1' />
<Page name='tab2' tabLabel='tab2' />
<Page name='tab3' tabLabel='tab3' />
<Page name='tab4' tabLabel='tab4' />
<Page name='tab5' tabLabel='tab5' />
<Page name='tab6' tabLabel='tab6' />
</ScrollableTabView>
</View>
</ScrollView>
)
}
}
AppRegistry.registerComponent('app', () => app) ANDremoving Android specific code in the component, that is ... eliminating the use of ViewPagerAndroid (since it's so troublesome). https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/index.js#L79 For the test, I changed those two lines to read So, the question for @skv-headless ... is there any special reason to use ViewPagerAndroid at all ? |
@jbrodriguez That actually works! But I wouldn't change it as: @skv-headless If it doesn't seem like something way wrong, you might wanna consider it. Can send out a pull request. |
@crozzfire I was forcing 'android' just as a proof of concept, but the right way would be a single path of execution, like you mentioned 👍 |
@jbrodriguez @crozzfire tried this way, really works like a magic!!! Thanks, really helped a lot |
@crozzfire I tried this approach, but even though the content started showing and swiping is working, scrolling is not. Has anyone else had this problem? |
@jbrodriguez Thank you so much! @skv-headless Is PageViewerAndroid really necessary? |
maybe it's fixed by this commit [(https://github.com/skv-headless/react-native-scrollable-tab-view/commit/5d8aeb1f8cc13cdfbb1bf75ea12866548f872edd)] @chromonav @tioback |
Thanks, @summersky92, I'll check it out later and post an update here. |
@tioback @skv-headless This commit 5d8aeb1 will make the sub ScrollablePage in ScrollablePage cannot be changed by sliding, and sliding just change the tab for parent. |
@gotounix not sure what do you mean. Can you please make a snippet which doesn't work. Thanks |
@skv-headless I meaning if using this commit 5d8aeb1 when I embed a ScrollablePage (child) in a ScrollablePage (parent), translation fingers sliding can't switch tabs in child, translation fingers sliding just switch tabs in parent.
|
I'm trying to add a parallax component around react-native-scrollable-tab-view, but I'm having the same issue. Did anyone resolve it? |
Hi @skv-headless |
For me, it does not relate to react-native-scrollable-tab-view. It related to the structure. for my example (I'm using react native base): Doesn't work code
class AnatomyExample extends Component {
}``` |
Hi what the status of this issue? because i'm facing the same issue by the way |
@prestawithme, yes.. same here. I'm modifying the height of the container of the ScrollTabView and I'm seeing content. Basically this is not working on android but it looks you have achieved that. Can you provide all the styles you have used? |
you can using this lib ! it fixed this bug |
thank you, it work for me |
@anhnguyenvan this work. only copy the code of file index.js to react-native-scrollable-tab-view |
thanks, |
I am using https://github.com/turfaa/react-native-scrollable-tab-view-universal and it works like a dream. Is there any reason why this has to be a separate project? Or can the changes in this fork be incorporated into this project (Which is far more popular)? |
This branch is 6 commits ahead, 11 commits behind. Are there any significant changes in that repo? |
I've now chcked the fork out @spencerkingman-niche and I will incorporate the idea of replacing the PageView with a ScrollView instead on the next write which I'm doing at this moment in #949 Thanks for pointer |
Thank you! |
@spencerkingman-niche @ptomasroos Hi, Why no pull request instead? Because it breaks in more cases. I forgot what are those cases, but it breaks. I thought the use of ViewPagerAndroid was intended because of those breaks. Is it better to add a parameter, letting users to choose which one to use (ScrollView vs ViewPagerAndroid)? |
Also got it to work with the fork package.json: "react-native-scrollable-tab-view": "git+https://github.com/turfaa/react-native-scrollable-tab-view-universal", and code below. Only issue I have now is the scroll view sets whichever tab has the biggest height, hopefully find a way to set this dynamic. Any suggestions? |
@andyr6381 im having the same problem, did find a solution? |
im having the same problem, did find a solution? |
@eramudeep couldnt find a solution, so I ended up using this with this approach, hope it helps! |
Tried in a normal View, works. But when I put ScrollableTabView component in a ScrollView ; it renders the tabs but not the child elements.
Using React Native 0.21 on Android
The text was updated successfully, but these errors were encountered: