Closed jruddell closed 6 years ago
@jruddell ScrollView component doesn’t support vertical paging on Android unfortunately.
@zachgibson can we add support for this? I kinda did a work around where I pass a scroll to property to the swiper after the on momentum callback... It's delayed but kinda works... Since we know what page for that call back couldn't we just snap to that page when it's vertical and you pass a new prop (say verticalSnap)?
Let me take a look at this and see what I can come up with. If I can make a solution that doesn’t feel janky we can add this to the lib, otherwise I’d say just fork this and do what you need to until a better solution arises.
@zachgibson sounds good, did you follow what i was trying to explain? i can try and help clarify or hop on a call with you or something if you'd like
@jruddell Yeah I believe so. We actually have an async function containing the content offset as we scroll. Might be able to use that to see where we are in the scroll position then on finger lift use scrollTo
to try and emulate the snapping effect.
@zachgibson Ah yea that would be awesome, sounds like its possible and maybe not that complicated actually.. Could also make this an optional thing, like either let them scroll freely or snap based on a new prop :) I'm fairly busy with work stuff but if i have some free time i could probably lend a hand
@jruddell Haven’t tested this idea yet, I have a feeling it won’t be ideal. The snapping should be instantaneous when you lift your finger, whereas this solution will need to measure where you are then call scrollTo
which will need to pass from JS to Native land.
If this PR got merged, we’d get this functionality natively: https://github.com/facebook/react-native/pull/10999 🤞
ahhh! I need this so badly as well. :(
When rendering a parallax swiper with vertical set to true (
<ParallaxSwiper vertical
) swiping up or down is just a regular scroll instead of snapping to the active page index.Steps to reproduce: Render the following sample. scroll half way between pages on android.
styles..