title: Unity Vertical Layout Group height not calculating off children
body: <p>I feel like I am not understanding the <code>Vertical Layout Group</code> component in Unity 2020.3.21 and I am hoping that someone can explain what I am missing.</p>
  <p>I have a series of runtime-controlled UI components that I want displayed vertically top-to-bottom. I need to be able to toggle these components on and off at run-time, and have the parent Vertical Layout Group size automatically update to the height of all of the active children. This is exactly the sort of thing the Vertical Layout Group is supposed to handle, right?</p>
  <p>When I build out a simple example, I am seeing that the Vertical Layout Group correctly positions the children in a vertical list. However, it competely ignores the sizes of the children when measuring it's own height. This is a problem because I want to be able to throw this container in a Scroll View -- if the height is not accurate, then the Scroll View doesn't work properly.</p>
  <p>Here's my demo. I have a series of children in a VLG that all have explicit set heights in their RectTransform. All of them are direct children of the VLG. None of them use a <code>LayoutElement</code>; all heights are explicitly defined in a <code>RectTransform</code>. Here's the scene hierarchy, with the compile-time RectTransform heights of each component in parenthesis.</p>
  <pre><code>Canvas (325x812)
    GameObject (812)
      Vertical Layout Group (100)
        Text (45)
        Spacer (100)
        Text Input (48)
        Spacer (20)
        Button (48)
  </code></pre>
  <p>Here are my VLG settings:</p>
  <p><a href="https://i.stack.imgur.com/Spwce.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Spwce.png" alt="enter image description here" /></a></p>
  <p>When I run the game, I can see the outline of each UI object in the <code>Scene</code> tab. The children clearly have their heights set. Yet the VLG still has it's static compile-time height of <code>100</code> instead of the sum of the child heights.</p>
  <p>Am I missing something about how the Vertical Layout Group works? How can I get this VLG to have it's <code>Height</code> property set to the actual total height of it's active children at runtime?</p>