Search Unity

Adjusting the height of UI Text according to content.

Discussion in 'UGUI & TextMesh Pro' started by m_danish_s, Sep 3, 2014.

  1. m_danish_s

    m_danish_s

    Joined:
    Sep 2, 2014
    Posts:
    13
    I am new to the unity's latest UI. What I know about UI Text Element is, we can wrap the text with in the horizontal bounds, but if it comes to next line, either it overflows or it truncates. If it fits in the height, font size decreases. What I want is to adjust the height of the text area according to the content it contains, without affecting the font size inside.

    How do I achieve it?
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Use the ContentSizeFitter component on the text.
     
    donaldwheaton likes this.