title: Android- how to properly scale Imageviews within a Scrollview to fit the height
body: <p>I have the following layout, which contains a <code>ScrollView</code> in which there is a <code>LinearLayout</code> containing 3 <code>ImageViews.</code>  The <code>ImageViews</code> actually hold pieces that comprise one large image (I had to do this because the single image took up too much memory).  Therefore, the images need to line up properly, but on certain devices, it appear that they are centered within the <code>ImageView</code> meaning they do not line up (see the attached image below).  So I'm wondering if there is a way to scale the images so that they fit the height of each <code>ImageView</code> within the <code>ScollView.</code>  The <code>ScollView</code> appears to have something to do with the problem, since if I get rid of it and just show the one of the <code>ImageViews</code> it scales properly, as opposed to scaling to the width (I want it scaled to the height).  The images the comprise the pieces are attached as well.  If anyone can tell me what I'm doing wrong in my layout or what scaleType I need to set to the ImageViews, I'd greatly appreciate it!</p>
  
  <p>
  </p>
  
  <pre><code>&lt;ScrollView
      android:id="@+id/scrollView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:fillViewport="true" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/top_background_0"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:src="@drawable/top_background_0" /&gt;
  
          &lt;ImageView
              android:id="@+id/top_background_1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:src="@drawable/top_background_1" /&gt;
  
          &lt;ImageView
              android:id="@+id/top_background_2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:src="@drawable/top_background_2" /&gt;
  
          &lt;ImageView
              android:id="@+id/top_background_3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:src="@drawable/top_background_3" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>
  <img src="https://i.stack.imgur.com/5zmHZ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/hw6wX.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/gE8mK.jpg" alt="enter image description here"></p>