0

I've a scrollview that displays a few bitmap imageviews to fill the screen. To support larger screens, I just want to scale the images. If I place a single imageview in the scrollview, it scales to fit (fill_parent). However, adding a second imageview underneath causes the imageviews to revert to actual size and not be upscaled to fill the screen.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/menu_ground"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/picture1" />

    <ImageView
        android:id="@+id/ImageView2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/picture2" />

    <ImageView
        android:id="@+id/ImageView3"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/picture3" />

    <ImageView
        android:id="@+id/ImageView3"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/picture4" />
</LinearLayout>

The images are located in the "drawable" folder, no dpi.

Tickled Pink
  • 969
  • 2
  • 14
  • 26

1 Answers1

1
 android:scaleType="scaleXY"

in your imageview

k1komans
  • 299
  • 1
  • 5
  • 13
  • Okay. I tried that but it only scaled horizontally, but that was only in the editor. Creating an HD AVD to test, it does scale correctly. – Tickled Pink Apr 30 '13 at 10:47