The ScaleType property in ImageView indicates how the picture is displayed, with a total of 8 values:
Matrix: Displays the picture to the defined width and height of the rectangle, without any scaling (the upper-left corner of the graphic aligns to the top-left corner of the rectangle). means that if the rectangle is larger than the shape, the picture is displayed in the upper-left corner, and if the rectangle is smaller than the shape, only the size of the rectangular portion of the graphic is displayed.
Fitxy: Enlarges/ shrinks the picture to the size of the view ( making sure the picture is fully displayed and full of view)
Fitstart: Scales the picture in equal proportions and displays it in the upper left of the rectangle ( making sure the picture is fully displayed and the short side of the rectangle is filled )
Fitcenter: Scales the picture in equal proportions and displays it in the middle of the rectangle (making sure the picture is fully displayed and the short side of the rectangle is filled ). default state of ImageView
Fitend: According to the picture according to the scale, and displayed in the lower right of the rectangle (to ensure that the picture will be fully displayed, the short side of the rectangle will be filled)
Fitstart, Fitcenter, fitend are all the same in three ways, except that they are displayed in different locations. Whether you zoom in or out, you must ensure that the short sides of the rectangle are filled.
Center: Do not do any zoom operation, the picture is centered on the original size, beyond the size of the ImageView is truncated, attention is truncated from both sides.
If the picture size is smaller than the ImageView size, the display is centered. ( picture may be partially shown )
Centercrop: Scales the picture to equal proportions and intercepts the zoomed-in middle section as it appears in ImageView. (Make the picture higher than the view, so that the image width is equal to or greater than the width of the view) ( picture may be partially displayed )
Centerinside: The picture size is larger than the ImageView picture is scaled down, until the entire picture can be centered in the ImageView, less than the imageview of the picture is not changed, directly centered display. ( picture full display )
The main difference between Centerinside and Fitcenter is that when the ImageView size is larger than the size of the image, Centerinside directly displays the original size of the image, while Fitcenter enlarges the picture so that the picture fills the short edge of the rectangle.
ScaleType Properties for Android ImageView