title: Scaling ImageView to device width
body: <p>In my Android App I have a Activity which show images which have following size <code>244 x 330</code>.
  I want to show those images in full device width.</p>
  
  <p>My layout file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
  
      &lt;LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"&gt;
  
              &lt;ImageView android:id="@+id/news_image" 
                  android:layout_height="fill_parent" 
                  android:layout_width="fill_parent"
                  android:layout_marginLeft="18dip"
                  android:layout_marginRight="18dip"
                  android:background="#aaaaaa" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>I tried to set the ScaleType of the ImageView but there is no ScalingType which scales the ImageView proportional.
  How can I scale the image proportionally to fit the whole screen in landscape mode AND portrait mode?</p>
  
  <p>Basically what I want is something like ScaleType.CENTER_CORP but which also sets the proportional height for the image so I can see all of it and not just a part of the image. </p>
  
  <p><strong>Edit cause I know I'm confusing you with my "weird" questing.</strong> </p>
  
  <p>I want to show it to you with a image.
  This is what I get at the moment with my layout. I want to fill the whole grey area by scaling the image as big as needed. How can I accomplish that?</p>
  
  <p><img src="https://i.stack.imgur.com/5vhMM.png" /></p>
  
  <p>When I set the <code>ScaleType</code> to <code>CENTER_CROP</code> I get this </p>
  
  <p><img src="https://i.stack.imgur.com/jMS4f.png" /></p>
  
  <p>but this is not what I want cause you are not seeing the whole image just a part from the center.</p>
  
  <p>And this is what I want it to be:</p>
  
  <p><img src="https://i.stack.imgur.com/52Mt1.png" /></p>
  
  <p>I hope this helps you to understand what I'm trying to accomplish.
  Anyone knows how to do that?</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>It might look weird and little confusing that I'm trying to display a image which is bigger in the height than the screen size but since I'm using a <code>ScrollView</code> in my example layout this should be ok and the user could scroll if he want to see the not displayed area.</p>
  
  <p>Hope this helps to understand what I'm trying to do.</p>