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?
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?
Share Improve this question asked Feb 24, 2018 at 19:32 Simon AnderssonSimon Andersson 7912 gold badges9 silver badges32 bronze badges 3-
Set
decelerationRate
to"fast"
. facebook.github.io/react-native/docs/… – Wainage Commented Feb 25, 2018 at 17:01 - 1 this is IOS only – Simon Andersson Commented Feb 26, 2018 at 18:36
- any luck with this 8 months later? – jpls93 Commented Oct 8, 2018 at 12:44
3 Answers
Reset to default 2Using 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 **
Add 2 following properties to ScrollView
:
snapToInterval={1}
disableIntervalMomentum={true}
Why not try this (RN 0.55)
<ScrollView
ref={r => (this.scrollView = r)}
onScrollEndDrag={e => {
return this.scrollView.scrollTo({ y: e.nativeEvent.contentOffset.y });
}}>
...
</ScrollView>