 <p>The default behavior of ViewSwitcher, as inherited by ViewAnimator, is to consider all child views on layout, which will result in the ViewSwitcher occupying the space of the largest child.</p> <p>To change this, all you need to do is to set the MeasureAllChildren flag to false. This will make the layout pass ignore the child view that is currently hidden. Set this flag e.g. in the onCreate method of the activity, e.g.:</p> <pre><code> ViewSwitcher switcher = (ViewSwitcher)findViewById(R.id.ViewSwitcher); switcher.setMeasureAllChildren(false); </code></pre> <p>XML example:</p> <pre><code>&lt;ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/viewSwitcher" android:measureAllChildren="false"&gt; &lt;/ViewSwitcher&gt; </code></pre>