Images in ScrollView in android

To make your Imageview scroll if it doesn’t fit in height, you can next a ImageView inside a ScrollView in the xml, & add this parameter –

android:adjustViewBounds="true"

Here’s an example –

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >
    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:background="@drawable/back" >
    </ImageView>
</ScrollView>

Leave a Comment