I have a large header image that I’d like to use for both tablet devices and phones. The image looks fine on a tablet but when viewed on a phone it looks like this:

Here is my layout XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/searchresults_header" />
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
How can I get this header image to scale correctly on both screen sizes?
Your image is getting resized automatically, but the viewbounds stay as they were originally.
Add this to your
ImageViewand you should see the difference:android:adjustViewBounds="true"