Imageview in a listview - Height is bugged?
- by Abdullah Gheith
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