title: Flex 4: Setting Spark List height to its content height
body: <p>How to set a <strong>Spark List</strong> height to the height of its content?</p>
  
  <p>Tried this:</p>
  
  <pre><code>var lastRow:IVisualElement =
                   myList.dataGroup.getElementAt(myList.dataGroup.numElements - 1);
  myList.height = lastRow.y + lastRow.height;
  </code></pre>
  
  <p>It works in case of a single item, but <em>lastRow</em> is null in case of more items.</p>