Search Unity

UI ScrollView strange behaviour

Discussion in 'UGUI & TextMesh Pro' started by TurleyE, Oct 24, 2016.

  1. TurleyE

    TurleyE

    Joined:
    Nov 2, 2015
    Posts:
    10
    I have been having a problem with the Scrollview, where after running the content moves outside of the viewport. I thought this was a problem with something that I had done, so I removed everything and tried with the default scrollview. How do I stop this from happening?

    View of behaviour:


    Edit: Seems to be connected to the height, though can't work out what. If the height of the scrollview is the same or just over that of the content it is fine. E.G. The default is 200 for the scrollview, 300 for the content. If you change the scrollview to 310 then it is fine with being 10 higher, but if you set it to 320 then it moves out of view.
    Looks like setting the content to scale in all directions seems to fix it, but I was sure I had tried that in the scene I was originally having the problem with.
     
    Last edited: Oct 24, 2016
  2. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    It's been broken like this since the new UI came out. It used to be that nothing in play mode could affect the data in edit mode, but the new UI breaks that, which is amazingly bad. If I remember correctly then a certain combination of pivots and anchors seemed to work around it.
     
  3. unity_AJo9-qZCyBoO5Q

    unity_AJo9-qZCyBoO5Q

    Joined:
    Oct 16, 2018
    Posts:
    2
    You are 100% correct, setting anchors to bottom left corner and setting both pivots to 0, worked for me.