There are several properties of ImageView's scaletype, namely matrix (default), center, Centercrop, Centerinside, Fitcenter, Fitend, Fitstart, Fitxy
Android:scaletype= "Center"
Keep the size of the original, displayed in the center of the ImageView. When the size of the original image is larger than the size of ImageView, the partial cropping is exceeded.
Android:scaletype= "Centercrop"
To fill the whole imageview for the purpose, the center of the original image to the center of the ImageView, and so on to enlarge the original image until the filling imageview (refers to the width and height of the ImageView to fill), the original version of more than the imageview part of the cut.
Android:scaletype= "Centerinside"
For the purpose of full display of the original image, the content of the picture is completely centered, and the size width (height) of the original is reduced by proportionally to or less than the width of the ImageView (high). If the size of the original is smaller than the size of ImageView, the size of the original is not processed and centered on the ImageView.
Android:scaletype= "Matrix"
Do not change the size of the original, from the upper left corner of the ImageView to draw the original image, the original more than the ImageView part for clipping.
Android:scaletype= "Fitcenter"
Enlarge or narrow the original image to the height of the imageview of the ImageView, centering on the display
Android:scaletype= "Fitend"
Enlarge (shrink) The original image to the height of the ImageView, shown in the lower part of the ImageView
Android:scaletype= "Fitstart"
Enlarge (shrink) The original image to the height of the ImageView, shown in the upper part of the ImageView
Android:scaletype= "Fitxy"
The original image is displayed in the view according to the specified size, stretched to show the picture, does not maintain the original proportions, fills the ImageView.
Attached below:
The original image is Pocoyo, the size of the original is greater than the size of ImageView, the size of the original is smaller than the size of ImageView
Original address: https://www.2cto.com/kf/201411/348601.html
ScaleType Properties and Adjustviewbounds properties for Android ImageView