About <ViewPagerAndroid> nested
See original GitHub issuereact-native v0.27.2 :
ViewPagerAndroid
nested , the inner ViewPagerAndroid
content couldn’t show 。
E.g :
<ViewPagerAndroid
style={{flex:1,backgroundColor:'#FF0000'}}
onPageSelected={(e)=>{}}
keyboardDismissMode="on-drag">
//===========outer View 1===========
<View>
<Text>Page 1</Text>
<ViewPagerAndroid
style={{flex:1,backgroundColor:'#FFFFFF'}}
onPageSelected={(e)=>{}}
keyboardDismissMode="on-drag">
//===========inner View 1===========
<View>
<Text style={{color:'#000000'}}>Sub Page 1</Text>
</View>
//===========inner View 2===========
<View>
<Text style={{color:'#000000'}}>Sub Page 1</Text>
</View>
</ViewPagerAndroid>
</View>
//===========outer View 2===========
<View>
<Text>Page 2</Text>
</View>
</ViewPagerAndroid>
The inner view couldn’t show , but can be slide !
Thx!
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ViewPager nested in ViewPager - android - Stack Overflow
I'm really newbie in android and I would appreciate any help for my course work. I need to do: 1) two ViewPagers (not...
Read more >ViewPager with FragmentPagerAdapter - CodePath Cliffnotes
... the screenshot above, you need to include a nested indicator view called a PagerTabStrip: <androidx.viewpager.widget.ViewPager android:id="@+id/vpPager" ...
Read more >Prevent Scroll Conflicts in Nested ViewPager | by Randy Arba
The first fragment will show Nested Viewpager, but the second fragment is not visible, to prove the view pager its work when sliding...
Read more >Migrate from ViewPager to ViewPager2 - Android Developers
ViewPager2 does not natively support nested scroll views in cases where the scroll view has the same orientation as the ViewPager2 object that ......
Read more >react-native-nested-scrollable-tab-view - npm
react-native-nested-scrollable-tab-view · Readme · Explore BETA · 2 Dependencies · 0 Dependents · 1 Versions ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Why did you close the issue ? It looks like there is still an issue with the ViewPagerAndroid component…
I think there is some kind of defect which causes the inner ViewPagerAndroid not being shown on the initial render. However I noticed when I change the height of the element in my script editor, it re-renders the inner view correctly and is visible without problem. This is a nasty workaround but it’s the only way I have managed to work around this issue.
In the inner ViewPagerAndroid add the following:
componentDidMount() { setInterval(() => this.setState({height: height, width: width}), 0); }
width and height is your desired dimension, however it must be different than what you pass to this component initially as obviously if you set it to the same values React will not re-render as the state would be already the same.