Imageview in a listview - Height is bugged?

Posted by Abdullah Gheith on Stack Overflow See other posts from Stack Overflow or by Abdullah Gheith
Published on 2011-01-03T08:38:52Z Indexed on 2011/01/03 8:53 UTC
Read the original article Hit count: 399

Filed under:
|
|

I am having a listview but i have problem i have the main.xml file, which contains a Listview:

<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="@drawable/gradient"
android:gravity="center"
android:padding="1pt">

<ListView android:id="@+id/ListView01" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:background="@android:color/transparent"
android:cacheColorHint="#00000000"/>

</LinearLayout>

Then, i have a custom listview file called listview.xml:

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:background="@android:color/transparent"
  android:cacheColorHint="#00000000">

<TextView android:gravity="center" android:textColor="#ffffff"
android:background="#0097D0" android:text="Overskrift"
android:id="@+id/tvOverskrift" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:textStyle="bold" />

<ImageView  android:id="@+id/ivBillede" android:scaleType="fitXY"
android:padding="2px" android:gravity="fill" 
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/test"/>

<TextView android:gravity="center" android:textColor="#ED2025" 
android:text="Dato" android:id="@+id/tvDato" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textStyle="normal"/>

<TextView android:gravity="left" android:textColor="#000000" android:text="Indledning"
android:id="@+id/tvIndledning" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textStyle="normal"/>

</LinearLayout>

the bitmap in the imagview i am getting is from a URL.

By that code, i am getting is this:
http://img585.imageshack.us/img585/5665/unavngivetv.png

I am getting too much space in the height as you see

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml