Size of images in imageview android
I have an imageView inside a listView. Set up like this: main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/listView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
image.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
This works great, filling in many images from url with http request. But I
have a problem with the size of the images. I want them to fill the screen
regardless the resolution or size. Tried with different layout hight,
width and scaleType but cant get it to work properly.
First image is how it looks now, second image is how i want it to look.
EDIT: tried with scaleType="fitXY" that gave me 100% width, but a bad
hight on the longer images.
No comments:
Post a Comment