SegementSlide
SegementSlide copied to clipboard
Scrolling slowly is not smooth when scrolling down
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?
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.
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.
I will try
There's a simple (although hacky) solution: never let content offset be 0. i.e. let it rest to 1.
Where?
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.
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.