title: How to set a maximum height with wrap content in android?
body: <p>In android, how can you create a scroll view that's got a max height, and wrap contents, basically it wraps the content vertically, but has a maximum height?</p>
  
  <p>I tried</p>
  
  <pre><code>&lt;ScrollView 
       android:id="@+id/scrollView1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
           android:maxHeight="200dp"
       android:layout_alignParentBottom="true" &gt;
  
      &lt;LinearLayout
          android:id="@+id/maincontainer"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>But this isn't working?</p>