Fit image into ImageView, keep aspect ratio and then resize ImageView to image dimensions?
问题 How to fit an image of random size to an ImageView ? When: Initially ImageView dimensions are 250dp * 250dp The image's larger dimension should be scaled up/down to 250dp The image should keep its aspect ratio The ImageView dimensions should match scaled image's dimensions after scaling E.g. for an image of 100*150, the image and the ImageView should be 166*250. E.g. for an image of 150*100, the image and the ImageView should be 250*166. If I set the bounds as <ImageView android:id="@+id