Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

Still having trouble with ScrollBars

Discussion in 'UGUI & TextMesh Pro' started by nventimiglia, Aug 27, 2014.

  1. nventimiglia


    Sep 20, 2011
    I have a scroll view with dynamically added items. When I add items to the scroll It works perfectly. When I register a scrollbar to the scrollview the scrollbar will zoom to the bottom of the container whenever items are added. It is very annoying.

    Here is a gif presentation.

    I also noticed that when the scroll view breaks my scroll container position, it is moved to -400 or so (at the bottom of the scroll view) I think this might be involved for some reason.

    Here is my add code

    Code (CSharp):
    1.  IEnumerator AddAsync(IEnumerable<object> objects)
    2.         {
    3.             foreach (var obj in objects)
    4.             {
    5.                 yield return 1;
    6.                 OnAdd(obj);
    7.             }
    9.             yield return 1;
    10.         }
    14.         GameObject GetNext()
    15.         {        
    16.                 var next = Instantiate(Prefab, RectTransform.position, RectTransform.rotation) as GameObject;
    17.                 next.transform.parent = RectTransform;
    18.                 // idk, scale sometimes goes wierd
    19.                 next.transform.localScale = RectTransform2.localScale;
    20.                 next.SetActive(true);
    21.                 return next;    
    22.         }
    As you can see I am doing nothing to adjust my scroll or my container. Why is it moving on me ?


    The issue only happens when you activate the scroll panel after load. My original bug-only prototype was working because it started active. When I started the scene with the container inactive then activated it in code - it broke. Uploading sample.

    Case 629305
    Last edited: Aug 27, 2014
  2. cowtrix


    Oct 23, 2012
    Yeah I'm encountering this too. Kind of annoying - it would be great if we could make scrollbars "sticky" (i.e. they don't change position without player input).
    nventimiglia likes this.
  3. Riolis


    Aug 23, 2014
    Yep, same thing happen to me, and I can't find a way to fix it. And its very frustrating.

    My scrollview started active tho, added the item to grid layout after I got some data from server, and it will scroll itself to bottom. (which is useful for chat window, but not on the other ones.)
    nventimiglia likes this.
  4. runevision


    Nov 28, 2007
    Thanks for the bug report! We'll look into it.
    Xaurrien and nventimiglia like this.