batuman
batuman

Reputation: 7324

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

Upvotes: 11

Views: 26742

Answers (3)

Raphael Royer-Rivard
Raphael Royer-Rivard

Reputation: 2252

I also had that problem and got it fixed by adding a Graphic Raycaster component to my element that had the Canvas component (the parent element to the Scroll View).

Upvotes: 0

Trake Vital
Trake Vital

Reputation: 1167

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

Upvotes: 1

Chuckiee3
Chuckiee3

Reputation: 121

  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.

Upvotes: 12

Related Questions