I'm developing a mobile app on Xamarin.
In the app, there's an ImageView
displaying an image that is too small to fit the width of the screen.
I want to scale the image to fit the width of the screen while maintaining the aspect ratio.
My axml
<LinearLayout
android:id="@+id/overlayImageContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/overlayImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitCenter"/>
</LinearLayout>
The result
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
I've tried various combinations of android:scaleType
and android:adjustViewBounds="true"
without success.