title: Scale ImageView to fit screen width/height while maintaining aspect ratio
body: <p>I'm developing a mobile app on Xamarin. </p>
  
  <p>In the app, there's an <code>ImageView</code> displaying an image that is too small to fit the width of the screen. </p>
  
  <p>I want to scale the image to fit the width of the screen while maintaining the aspect ratio. </p>
  
  <p><strong>My <code>axml</code></strong></p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/overlayImageContainer"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"&gt;
      &lt;ImageView
          android:id="@+id/overlayImageView"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:adjustViewBounds="true"
          android:scaleType="fitCenter"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>The result</strong></p>
  
  <p>Two ImageViews displaying a) a picture that is wider than the width of the screen and b) a picture that is narrower than the width of the screen</p>
  
  <p><a href="https://i.stack.imgur.com/santQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/santQ.png" alt="Two ImageViews displaying a) a picture that is wider than the width of the screen and b) a picture that is narrower than the width of the screen"></a></p>
  
  <p>I've tried various combinations of <code>android:scaleType</code> and <code>android:adjustViewBounds="true"</code> without success.</p>