纠结了半天怎么把一个比较修长的图片,宽度拉伸开,长度也等比例显示的问题。
最后推敲出解决办法如下
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0E0E0E">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY">
</ImageView>
<!-- <com.github.chrisbanes.photoview.PhotoView-->
<!-- android:id="@+id/image"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:scaleType="centerCrop">-->
<!-- </com.github.chrisbanes.photoview.PhotoView>-->
</LinearLayout>
</ScrollView>