Search Issue Tracker

Not Reproducible

Votes

11

Found in

4.6.0b18

Issue ID

631175

Regression

No

When a Scrollbar is set on a ScrollRect you can no longer control the size value for the scroll bar so that it doesn't stretch

UI

-

How to reproduce:

1. Open the attached project
2. Open "Test" scene (it has ScrollRect created, a content view for the ScrollRect, which is 5 times the size of the ScrollRect. Also Scrollbar which is attached to the Horizontal Scrollbar property of the ScrollRect.)
3. Select Scrollbar in Hierarchy and try to change the value of Size in Inspector
4. Notice it doesn't let to change it

Comments (5)

  1. _Gregory_

    Mar 06, 2017 07:37

    Same in unity 5.5.1.
    Size of the scrollbar change automatically when press Play! (Size persistant: 0.43824)

  2. Ensutee

    Mar 22, 2016 11:47

    It is caused by the scrollrect's attempt to scale the scrollbar in order to represent the portion of the content area that you are currently viewing (like a standard windows scrollbar does).
    In order to circumvent this behaviour you can remove the scrollbar reference from the scrollrect and add a small script which reads the ScrollBar.value and then sets the ScrollRect.normalizedPosition accordingly instead.

    http://docs.unity3d.com/462/Documentation/ScriptReference/UI.Scrollbar-value.html
    http://docs.unity3d.com/ScriptReference/UI.ScrollRect-normalizedPosition.html

  3. JaisonRobson

    Apr 01, 2015 10:18

    i found a solution to this problem, i bet you can use as well, this is the link of the solution/solved problem: http://forum.unity3d.com/threads/anybody-got-scrollrects-to-cooperate-with-dynamic-content.265600/

    they said that you need to use a component called "Content Size Fitter", and set the axis that u want to fit within the elements and the RectTransform object of the content of the scrollview. it worked for me and saved me :) if u are getting resizing errors with scrollbars and scrollrects it worths to try in your project.

  4. JaisonRobson

    Apr 01, 2015 09:44

    Im getting the same, exactly error/issue... i expect that someone could give us a light... to our problem...

  5. sennin31

    Sep 12, 2014 08:36

    Same thing here, and I can add that I have the same issue with the "Value" of the scroll bar.

    If I put the value I want, another value is randomly set. Also, after a play, sometimes the value isn't reset to the original value.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.