Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Scrollview Stop Momentum? (expo)

I am using a ScrollView, and when I scroll and let go, it keeps scrolling because of momentum. I want it to only scroll when the finger is touching the screen, I do not want the momentum. Is this possible, if so, how?

like image 829
Simon Andersson Avatar asked Feb 24 '18 19:02

Simon Andersson


1 Answers

Using decelerationRate prop with value 0 can help.

Based on the document, its value accept string normal | fast and floating number from 0 to 1 orderly from slowest to fastest.

<ScrollView decelerationRate={0}>

</ScrollView>

** I am using RN v0.59 **

like image 89
Ponleu Avatar answered Jan 02 '23 09:01

Ponleu