Open antonioaltamura opened 6 years ago
Why is this package using ViewPagerAndroid
? Seems ScrollView
is perfectly cross-platform. I believe ViewPagerAndroid does not have vertical scrolling which prevents this option. Maybe just unwrap this conditional render and remove ViewPagerAndroid
?
renderScrollView = pages => {
if (Platform.OS === 'ios') {
return (
<ScrollView ref={this.refScrollView}
{...this.props}
{...this.scrollViewPropOverrides()}
contentContainerStyle={[styles.wrapperIOS, this.props.style]}
contentOffset={this.state.offset}
onScrollBeginDrag={this.onScrollBegin}
onMomentumScrollEnd={this.onScrollEnd}
onScrollEndDrag={this.onScrollEndDrag}
style={this.props.scrollViewStyle}>
{pages}
</ScrollView>
)
}
return (
<ViewPagerAndroid ref={this.refScrollView}
{...this.props}
initialPage={this.props.loop ? this.state.index + 1 : this.state.index}
onPageSelected={this.onScrollEnd}
key={pages.length}
style={[styles.wrapperAndroid, this.props.style]}>
{pages}
</ViewPagerAndroid>
)
}
You could still conditionally render the styles.
Maybe it's changed a lot since you first built this, but it looks fine to use for Android. https://facebook.github.io/react-native/docs/scrollview.html
I've now come to realize that both components do not allow vertical paging on Android. Could we perhaps live with a JavaScript implementation of page snapping for Android until the native vertical paging is supported on ScrollView?
I'm not sure where you see ViewPagerAndroid in my code..anyway I solved using https://www.npmjs.com/package/@nart/react-native-swiper
@antonioaltamura It's in the source for react-native-swiper. I would like to know how @nart solved it given that neither ScrollView nor ViewPagerAndroid support native vertical paging for Android... I can't find the source repo for @nart/react-native-swiper
.
Sorry, I read again your posts and understood your doubt. it seems this package is not greatly supported..I will take a look to the souce of @nart then..
可以说中文吗
@antonioaltamura the command npm i @nart/react-native-swiper
seems not work well, but fighting!
can say chinese?
1
+1
npm i @nart/react-native-swiper still not work,"react": "16.3.1","react-native": "0.55.4",
after almost an year, does this bug is still on?
Which OS
Win 7 x64
Version
Which versions are you using:
Expected behaviour
Vertical swiper
Actual behaviour
Horizonal default swiper, with vertical buttons
Steps to reproduce
I've just installed RN and react-native-swiper. This is the code of the component