Stretch layout to screen
<p>I have the following layout. I'm using layout_weight="1", so that everything will stretch to fit the screen uniformly. The user has the option to delete images, by basically setting visibility="gone".</p>

<p>Let's say the user deletes both images in the middle LinearLayout, I want that layout to disappear. Currently, if you delete both images the empty layout stays there leaving a gap. How might I get this to work properly so that the other layouts fill in the empty space?</p>

<pre><code>&lt;LinearLayout android:orientation="vertical" android:width="fill_parent" android:height="fill_parent"&gt;
   &lt;LinearLayout android:orientation="horizontal" android:layout_weight="1"&gt;
      &lt;Image&gt;&lt;/Image&gt;
      &lt;Image&gt;&lt;/Image&gt;
   &lt;/LinearLayout&gt;
   &lt;LinearLayout android:orientation="horizontal" android:layout_weight="1"&gt;
      &lt;Image&gt;&lt;/Image&gt;
      &lt;Image&gt;&lt;/Image&gt;
   &lt;/LinearLayout&gt;
   &lt;LinearLayout android:orientation="horizontal" android:layout_weight="1"&gt;
      &lt;Image&gt;&lt;/Image&gt;
      &lt;Image&gt;&lt;/Image&gt;
   &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>
