Search Unity

Unity UI Placing UnityEngine.UI.Text at top of Scroll Rectransform.

Discussion in 'UGUI & TextMesh Pro' started by Griffo, Aug 15, 2017.

  1. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi,
    I'm reading a list of strings into my UnityEngine.UI.Text and using a content size filter set to vertical fit "Preferred Size".

    All works fine but then the UnityEngine.UI.Text is placed centre of the Scroll Rectransform, as in the picture below.

    How could I get it to start at the top of the Scroll Rectransform? I was trying to read the Rectransform's height then was going to place it lower by half its height but by using the content size filter the height is greyed out and only returns the height before play is pressed, any help or direction would be greatly appreciated, thanks.

    Screen Shot_00.jpg Screen Shot_00.png
     
  2. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    OK, done it by accessing the Scrollbar value and setting it to 1 ..