我有一个图像,我缩放到手机/平板电脑的宽度。它是224x1632。 imageview是在滚动视图内,我需要能够在该图像上上下滚动。滚动查看+缩放图片=不正确滚动,为什么不呢?
问题是滚动视图在创建时根据图像大小(长度为1632)进行设置,但是当图像缩放/拉伸时,它比原始图像高出3倍。现在滚动视图太小而无法滚动整个图像。
任何方式使滚动视图适合图像?
注意:每部手机的图像长度会有所不同,因此我无法将其设置为预定大小。
XML代码:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerCrop"
android:scrollbars="vertical"
android:src="@drawable/tiles" />
</ScrollView>
你解决了吗? – l33t 2013-08-23 21:42:13