- Home /
Force a ScrollRect/ScrollView to stop scrolling
Normally a scrollrect will stop scrolling automatically when you stop dragging it. I need a clean way to force it to stop scrolling, even the user has not stopped dragging it. I've searched through the api and even tried some hacky solutions...nothing with perfect results though.
What should trigger the stop of the scrolling? what are you trying to do exactly?
Ultimately I'm trying to drag an item out of a scroll list. I have it done, except the part I'm asking about. I'm going to trigger it to stop once the item is committed to exiting the scroll area....which is also done. I just can't get the scroll to stop. It will stop after I let go of the item of course, but I'm trying to force it to stop arbitrarily before that happens for cosmetic reasons.
Answer by Yword · May 19, 2015 at 10:38 AM
The following code will stop the movement and disable dragging:
scrollRect.StopMovement();
scrollRect.enabled = false;
Your answer

Follow this Question
Related Questions
2 finger scrolling 1 Answer
How to remove/hide GUI scroll bar 7 Answers
ListView scrolling with swipe 2 Answers
New UI Scrollview with changing content 1 Answer
Problem with Scrollview 0 Answers