<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/res_version_bg" />
<!-- Set this to true if you want the ImageView to adjust its bounds
to preserve the aspect ratio of its drawable. -->
如果希望ImageView調整其邊界,請將此設置為true 以保持其可拉伸的長寬比
<attr name="adjustViewBounds" format="boolean" />
把圖片按比例擴大/縮小到View的寬度,顯示在View的上部分位置
android:scaleType="fitXY"