SegementSlide icon indicating copy to clipboard operation
SegementSlide copied to clipboard

Scrolling slowly is not smooth when scrolling down

Open danqing opened this issue 6 years ago • 7 comments

When scrolling down, if you scroll too slowly the deceleration phase will stop when the child scroll view reaches the top. Interestingly when scrolling up it's fine.

I suspect that it's due to the rubber band effect, but it also shouldn't be as both scroll views should be receiving the gesture.

Any thoughts?

danqing avatar Aug 03 '19 03:08 danqing

Thanks for feedback!

I have got it.

When scrolling down, if you scroll too slowly the deceleration phase will stop when the child scroll view reaches the top.

This is due to the scrollView's rolling feature. when scrolling down, the contentOffset's y of subScrollView will increased slowly from 0.(contentOffset's y increased from 0 will be always slowly)

but it also shouldn't be as both scroll views should be receiving the gesture.

Currently, the implementation of SegementSlide rely on both scroll views should be receiving the gesture.

Jiar avatar Aug 13 '19 02:08 Jiar

If you look at Twitter/Instagram, their scrolling is completely smooth. I think this should be a goal for segment slide.

Currently, the implementation of SegementSlide rely on both scroll views should be receiving the gesture.

That's what I meant. The inner scroll view is always receiving gesture, so I thought it should already have an initial velocity.

danqing avatar Aug 13 '19 03:08 danqing

I will try

Jiar avatar Aug 28 '19 02:08 Jiar

There's a simple (although hacky) solution: never let content offset be 0. i.e. let it rest to 1.

danqing avatar Aug 28 '19 04:08 danqing

Where?

Nahatakyan avatar Nov 08 '19 10:11 Nahatakyan

There's a simple (although hacky) solution: never let content offset be 0. i.e. let it rest to 1.

Thanks! It works in my own implementation. BTW, do you figure it out by yourself or have any reference articles? I want to learn more about similar problems.

jjaychen1e avatar Jun 05 '21 09:06 jjaychen1e

I figured it out myself. But intuitively it makes sense too - by not letting it be 0 the physics engine probably won't treat it as a "wall", so the acceleration mechanism is different.

danqing avatar Jun 09 '21 17:06 danqing