设置adjustViewBounds // 是否保持宽高比
<ImageView
android:id="@+id/iv_test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_gravity="center"/>
设置adjustViewBounds // 是否保持宽高比
<ImageView
android:id="@+id/iv_test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_gravity="center"/>
本文标题:Android ImageView高度根据图片比例自适应
本文链接:https://www.haomeiwen.com/subject/rqplzttx.html
网友评论