title: android ScrollView layout (wrap_content, maximum size)
body: <p>Here is what I would like my ScrollView to look like:</p>
  
  <ul>
  <li>The maximum size is defined with the layout_weight (so that other items below the ScrollView can be displayed properly)</li>
  <li>If the content is smaller than that maximum size, then it just behaves as with <code>layout_height="wrap_content"</code></li>
  </ul>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>&lt;ScrollView
              android:layout_height="wrap_content"
              android:layout_width="fill_parent"
              android:measureAllChildren="true"
              android:fillViewport="false"
              &gt;
  </code></pre>
  
  <p>I don't think the <code>measureAllChildren</code> really does anything at all...</p>
  
  <p>If I add <code>android:layout_weight</code>, the size will always be what I would like the maximum to be. Without it, it just extends more than it should...</p>
  
  <p>I don't mind extending the ScrollView class to change the behavior of onMeasure if I need to...?</p>
  
  <p>PS: If that makes a differences, I am trying to get this working from Froyo onward.</p>