2018/8/13

android:src="@drawable/Picture location"
android:
/>

android:scaleType="center".
使图像在视图中居中,但不执行缩放。
android:scaleType="centerCrop".
缩放图像(保持图像的纵横比),使得图像的尺寸(宽度和高度)都等于或大于视图的相应维度(减去填充)。然后将图像集中在视图中。


CENTER
added in API level 1
public static final ImageView.ScaleType CENTER
Center the image in the view, but perform no scaling. From XML, use this syntax: android:scaleType="center".


CENTER_CROP
added in API level 1
public static final ImageView.ScaleType CENTER_CROP
Scale the image uniformly (maintain the image’s aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop".
API参考

你可能感兴趣的:(android)