2018/8/13

1066 ワード

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リファレンス