title: Adding layout to a scrollview gets eaten up
body: <p>I have a layout something like this:</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:layout_marginBottom="10dp"
      android:background="#ff303f"
      android:id="@+id/layout"&gt;
      &lt;ImageView 
          android:id="@+id/picture"
          android:layout_width="300dp"
          android:layout_height="300dp"
          android:layout_centerInParent="true"/&gt;
      &lt;Button
          android:id="@+id/cancel"
          android:layout_width="45dp"
          android:layout_height="45dp"
          android:layout_alignRight="@id/picture"
          android:background="@drawable/cross_out"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I inflate it using the usual layout inflator service, set up some functionality to the button and an image to the imageview (all images are of same size and aspect ratio).</p>
  
  <p>After that, I add this view to my fragment's layout which is nothing but a ScrollView which is a parent, it has a child linear layout that I call 'map' and simply add it to the map.</p>
  
  <p>Expected : The added layouts should get added properly and I can scroll through it.
  Actual : If more than 2 are added, the first one gets eaten up. I can see it half or sometimes it is completely eaten up. :\</p>
  
  <p>Any idea whats going on here? Thanks a lot for your time.</p>
  
  <p>EDIT:
  Here's the layout file I add the inflated layout into:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView 
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/scrollView"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#f6ff45"&gt;
          &lt;LinearLayout
              android:id="@+id/map"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="#43ff44"
              android:orientation="vertical"
              android:layout_margin="10dp"
              android:layout_gravity="center"
              android:layout_marginTop="15dp"&gt;
  
  &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>I also forgot to mention that after adding 3 or more of these layouts, I realized there's unnecessary empty space in the end. :\</p>