ImageView's scaleType property

 
The meaning of each value in the scaleType property of ImageView :
 
1.matrix : matrix display, display the original size of the picture, without scaling, not centering, if the picture size is smaller than the View size, it will be displayed in the upper left corner; if the picture size is larger than the View size, it will display the View size on the upper left of the picture.
2.fitXy : Don't care about the size of the image, fill the entire View, and stretch the image according to the View size.
3.fitStart : Proportional scaling of the picture, the length or width fills the View, and is displayed on the left or upper position of the View.
4.fitCenter : Proportionally scale the picture, fill the View in length or width, and display it in the middle of the View.
5.fitEnd : Proportional scaling of the picture, the length or width fills the View, and is displayed at the right or lower position of the View.
6.center : When the size of the image is larger than the size of the Veiw, it will be scaled down proportionally, and the middle part will be intercepted and displayed in the center. When the size of the image is smaller than the size of the View, it will be displayed in the center.
7.centerCrop : Centered display, when the size of the picture is larger/smaller than the size of the View, it is scaled proportionally, the View is completely filled, and the middle part is intercepted and displayed in the center.
8.centerInside : When the image size is smaller than the View size, it will not be enlarged and displayed in the center; when the image size is larger than the View size, it will be proportionally reduced and displayed in the center.
xml:
android:scaleType="fitStart"
 java:
imageView.setScaleType(ImageView.ScaleType.MATRIX);
 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327008566&siteId=291194637