1、想实现图片横向占满ImageView,在保持横宽比的条件下,纵向实现包裹内容,需用如下属性搭配,关键在于adjustViewBounds属性为true,ScaleType用centerCrop
android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop"
1、想实现图片横向占满ImageView,在保持横宽比的条件下,纵向实现包裹内容,需用如下属性搭配,关键在于adjustViewBounds属性为true,ScaleType用centerCrop
android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop"