How to scale an Image in ImageView to keep the aspect ratio

Yes, by default Android will scale your image down to fit the ImageView, maintaining the aspect ratio. However, make sure you’re setting the image to the ImageView using android:src=”…” rather than android:background=”…”. src= makes it scale the image maintaining aspect ratio, but background= makes it scale and distort the image to make it fit exactly … Read more