React-native-swiper: Vertical Scroll is not working on Android

Created on 22 Jun 2016  路  27Comments  路  Source: leecade/react-native-swiper

I've tested on Android.

Vertical Scroll is not working.

Anyone helping me?

Most helpful comment

"+1"s are so annoying. Why not use the reaction feature and add a "thumbs up" or something like it?

All 27 comments

+1

+1

+1

+1

+1

I believe this is not an issue for me anymore, as I am successfully rendering using Scrollviews on android as well.

+1 (paging not working in android branch)

+1

+1

"+1"s are so annoying. Why not use the reaction feature and add a "thumbs up" or something like it?

+1

+1
any news as it's a very old topic

+1

+1
Hasn't it been solved yet?

Any news on this?

+1

+1

+1
If you render a scrollview as a page of swiper you cant scroll it on Android. IOS is fine.

Edit:
-1

A scrollview within the Swiper works on Android like expected. What you have to ensure is that you specify the height of the Swiper and the nested ScrollView. The problem we run into was likely that the ScrollView's height was as huge as its content so scrolling isn't needed/possible.

I did the following:

  1. Calculated the exact height for each swiper page
  2. Set height to height prop of Swiper
  3. Pass the same height as style to the Swiper children (ScrollView)

This works like a charm. I can scroll the content of the ScrollView vertically and the Swiper horizontally.

Hope this helps you guys...

Would it cause some problem if I changed "ViewPagerAndroid" to "ScrollView" in android?

I am willing to work on fixing this issue. However, I am new to this project. Can anyone guide me to any leads as of yet?
Thanks.

ViewPagerAndroid does not support vertical scrolling as the native component does not support it.
http://stackoverflow.com/questions/13477820/android-vertical-viewpager

ScrollView supports vertical scrolling on Android but not vertical paging.
https://github.com/facebook/react-native/issues/11020

I don't know if it is possible to achieve this without native code.

Native implementations of a vertical ViewPager:
https://github.com/grantland/android-verticalpager
https://github.com/JakeWharton/Android-DirectionalViewPager
https://github.com/castorflex/VerticalViewPager

@norman-kapschefsky How did you calculate the height of each swiper page?

Does anyone working on a REAL solution about this ?

Here is the solution.Please use swiper from this package and import like below.
import Swiper from '@nart/react-native-swiper'

https://www.npmjs.com/package/@nart/react-native-swiper

Thank you @abdulbasit1248 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gwhite-dayspring picture gwhite-dayspring  路  3Comments

agzuniverse picture agzuniverse  路  3Comments

ghost picture ghost  路  3Comments

Liqiankun picture Liqiankun  路  3Comments

itinance picture itinance  路  3Comments