ScaleType Property
Article Source: http://blog.csdn.net/xilibi2003/article/details/6628668
The ScaleType property is often used when using imageview, such as:
1 < android:layout_width= "50DP"2android:layout_height= "50DP" 3 Android:scaletype = "Matrix" 4 android:src = "@drawable/sample_small" />
ScaleType attribute values are: Matrix fitxy fitstart fitcenter fitend Center Centercrop centerinside
The differences between them are as follows:
Matrix is drawn with matrices (from the matrix area starting at the top left) fitxy the picturedo not scale up/down to view size display (make sure the picture is fully displayed and full of view) Fitstart the picturescale up/down to the width of the view, displayed in the upper part of the view (the picture will be displayed in full) Fitcenter the pictureZoom in /out to the width of the view, centered (the picture will be displayed in full)
Fitend the pictureZoom in/out to the width of the view, displayed in the lower part of the view (the picture will be displayed in full)
Center by the original size of the picture is displayed, when the picture is wider than the width of the view, then the center portion of the image is captured, when the picture is less than the width of the view, the picture is centered
Centercrop PressScale up/down the size of the image is centered so that the picture is higher than the view, making the picture wider or larger than the width of the view
Centerinside the contents of the picture to the full center, so that the picture is scaled down or the original size (picture than view hours) so that the picture width is equal to or less than the width of the view ( picture will be full display) Attach two experiments: Figure 1: Picture larger than ImageView Figure 2: Figure ratio ImageView Small experiment
Android ImageView ScaleType Properties