Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved Expanding panel with scrollbars when max size

Discussion in 'UGUI & TextMesh Pro' started by diggyk, Jan 3, 2021.

  1. diggyk

    diggyk

    Joined:
    Aug 16, 2014
    Posts:
    24
    I've been struggling to get this to work correctly and I'm hoping people can help me.

    I'm trying to make UI that expands vertically as an internal ScrollView also expands. So I want the ScrollView to keep expanding to a max size as I add children to the Content and as it does, the main parent panel should expand vertically as well up to a max size.

    (Please see the attached image).

    So, the brown section is the ScrollView that should expand based on its content. The main parent panel (seen in white) has a Title (TextMeshPro) on the top, and another below the ScrollView, and then some Buttons in the HorizontalLayoutGroup below that.

    I've tried so many combinations of ContentSizeFitters on various parents and children and Layout Elements and oh so many things and I'm just lost. Any help would be greatly appreciated here.
     

    Attached Files:

  2. diggyk

    diggyk

    Joined:
    Aug 16, 2014
    Posts:
    24
    I found an answer to similar question and I've figured this out. For others who need to know how to do this, please check out this detailed document I created.
     

    Attached Files: