React Native Scrollview 停止动量?(博览会) [英] React Native Scrollview Stop Momentum? (expo)
本文介绍了React Native Scrollview 停止动量?(博览会)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 ScrollView,当我滚动并让去,它会因为动量而不断滚动.我希望它只在手指触摸屏幕时滚动,我不想要动力.这可能吗,如果可能,怎么办?
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?
推荐答案
使用值为 0
的 decelerationRate
属性会有所帮助.
Using decelerationRate
prop with value 0
can help.
基于文档,其值接受字符串正常|fast
和浮点数从 0
到 1
从最慢到最快的顺序.
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>
** 我使用的是 RN v0.59 **
** I am using RN v0.59 **
这篇关于React Native Scrollview 停止动量?(博览会)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文