Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity scrollview can't scroll to the end

I have a scrollview.Horizontal and vertical scrollbars are removed because it is ugly and I have space constraint.

When I populate items into content of the scrollview as shown in the image enter image description here

I can't scroll. The view is moving but doesn't scroll. When I scroll, just scroll to some extent and scroll back to the original position.

What could be wrong?

enter image description here

like image 915
batuman Avatar asked Dec 08 '17 16:12

batuman


2 Answers

  1. Check if you have Vertical checkbox enabled on Scroll Rect component.
  2. On your content object after adding ContentSizeFitter, you need to select either Min Size or Preferred Size to make the scroll view content automatically resize. The unconstrained option doesn't drive the height so your scroll view won't scroll.
like image 52
Chuckiee3 Avatar answered Dec 12 '22 09:12

Chuckiee3


Make sure that the Height parameter in the Content object is not equal to zero:

enter image description here

What happens when you press play:

enter image description here

Now let's set Height to something much bigger than zero:

enter image description here

Here is what we get when we press play this time:

enter image description here

(The scroll bar appeared!)

Credit: Unity scrollview can't scroll to the end

like image 23
Trake Vital Avatar answered Dec 12 '22 09:12

Trake Vital