look this video of current scrolling behavior. i want, as soon as finger is lifted from screen, to disable scrolling.
Edit: the video shows a user scrolling through a list. When the finger is lifted from the screen, you see the scrolling continues up or down for a short time.
look this video of current scrolling behavior. i want, as soon as finger is lifted from screen, to disable scrolling.
Edit: the video shows a user scrolling through a list. When the finger is lifted from the screen, you see the scrolling continues up or down for a short time.
Share Improve this question edited Dec 5, 2017 at 0:27 leanne 8,8091 gold badge57 silver badges81 bronze badges asked Dec 4, 2017 at 14:49 Andrey ShostikAndrey Shostik 1942 silver badges13 bronze badges 1- Added an explanation of the video. This way, readers don't have to leave this page to understand what you're looking for. Also, if the video is unavailable for some reason, people still can understand your question. – leanne Commented Dec 5, 2017 at 0:27
3 Answers
Reset to default 3I think what you need is:
<ScrollView
bounces={false}
/>
This way when you scroll finished, the scroll animation will not continue and immediately stopped.
What I believe you want is basically to stop the scroll when momentum beings. For that, you can use the onMomentumScrollBegin
callback on your ScrollView and call .scrollToEnd({animated: false})
on it.
Here's how that would look:
<ScrollView
ref={(ref) => this.scrollView = ref}
scrollEnabled={this.state.scroll}
onMomentumScrollBegin={
() => this.scrollView.scrollToEnd({animated: false})
}
>
...CONTENT HERE...
</ScrollView>
i think u mean stop scrolling once user lifts his finger try :
<ScrollView
...
decelerationRate = {0}
/>
check docs
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744727195a4590250.html
评论列表(0条)