title: Fragment inside a ScrollView is too small
body: <p>Short question: I want the fragment, which is inside a scroll view, to occupy all the available space. How can I achieve that?</p>
  
  <p>Details: I have a fragment, which I put inside a ScrollView in the parent layout. That scroll view occupies most of the space in the parent layout. Despite that, the fragment appears very small inside the scroll view. The picture illustrates this: </p>
  
  <p><img src="https://i.stack.imgur.com/u7UNp.jpg" alt="the fragment, or the scroll view, doesn&#39;t take the whole space"></p>
  
  <p>This is the XML for the fragment:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/ImagePickerGridView" android:orientation="vertical"
      android:layout_width="fill_parent" android:layout_height="fill_parent"
      android:gravity="center" android:stretchMode="columnWidth"
      android:numColumns="auto_fit" android:horizontalSpacing="5dp"
      android:verticalSpacing="5dp" android:background="@color/orange1"&gt;
  &lt;/GridView&gt;
  </code></pre>
  
  <p>This is the XML for the parent layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/LinearLayout1" android:orientation="vertical"
      android:layout_width="fill_parent" android:layout_height="fill_parent"
      android:gravity="center" android:stretchMode="columnWidth"
      android:numColumns="auto_fit" android:horizontalSpacing="5dp"
      android:verticalSpacing="5dp"&gt;
      &lt;ScrollView android:layout_width="match_parent"
          android:id="@+id/imagePickerScrollView" android:layout_weight="1.0"
          android:layout_height="match_parent" android:background="@color/orange1" android:layout_gravity="fill_vertical"&gt;
      &lt;/ScrollView&gt;
      &lt;LinearLayout android:id="@+id/linearLayout3"
          android:layout_width="match_parent" android:layout_height="wrap_content"
          android:background="@color/blue1"&gt;
          &lt;Button android:layout_height="wrap_content"
              android:layout_width="wrap_content" android:layout_weight="1.0"
              android:text="@string/ImportSelectedButton" android:id="@+id/importSelectedButton"
              android:layout_marginLeft="@dimen/standardMargin"
              android:layout_marginTop="@dimen/standardMargin"
              android:layout_marginBottom="@dimen/standardMargin" android:onClick="onImportSelected"&gt;&lt;/Button&gt;
          &lt;Button android:layout_height="wrap_content"
              android:layout_width="wrap_content" android:layout_weight="1.0"
              android:text="@string/CancelButton" android:id="@+id/cancelButton"
              android:layout_marginRight="@dimen/standardMargin"
              android:layout_marginTop="@dimen/standardMargin"
              android:layout_marginBottom="@dimen/standardMargin" android:onClick="onCancel"&gt;&lt;/Button&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And finally, this is how I add the fragment to the activity:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.image_picker_1);
  
      Log.d(CLASS_NAME, "onCreate");
  
      m_multiPicSelect = getIntent().getBooleanExtra(IntentHelper.MULTI_SELECT, false);
      FragmentManager fragmentManager = getSupportFragmentManager();
      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  
      Fragment fragment = new ImagePickerFragment();
      fragmentTransaction.add(R.id.imagePickerScrollView, fragment);
      fragmentTransaction.commit();
  }
  </code></pre>