- Home /
How to disable ScrollView dragging
I have a scrollview that scrolls when I drag and when I use the scrollbar, but I want to disable dragging the scrollview. How do I do that?
Answer by martin-protostar · Feb 19, 2016 at 12:41 AM
To disable dragging, set Vertical & Horizontal Scroll to false, then it can only be controlled by a scrollbar.
Tried this and the scrollbar disappeared. In my opinion it's a false statement, but if I missed something please tell.
Answer by panayiotismilios · Aug 18, 2020 at 04:20 PM
In the ScrollView object, set the movement Type from Elastic to Clamped
Answer by renanbp · May 20, 2020 at 03:58 AM
I think I just found the answer. In the inspector for the ScrollRect Monobehavior, if you remove the reference to the Viewport there (set it to none), it appears that it solves the problem without causing any other issues. (Probably that's the only use for this reference, since the Content is the one manipulated by the scrolling)
Answer by vin4bacchus · Sep 28, 2021 at 06:20 PM
In the ScrollRect script inspector of the ScrollView object, unclick the Horizontal checkbox directly below Content. This prevents dragging horizontally. Likewise the Vertical checkbox controls vertically. The scroll view can only be scrolled programmatically after unchecking.
Your answer
Follow this Question
Related Questions
Scroll Rect Min/Max Size 0 Answers
Scroll Rect doesn't display items Unity 5.6 2 Answers
UGUI ScrollRect automatic scroll? (Chat) 1 Answer
GUIlayout scrollbar, Not working well... 1 Answer
Why is my scrollbar not working? 4 Answers