4

I have a Custom ListView with an imageview and 2 TextViews above each other next to the imageview. The bottom textView hold a description of the title, but it it cut off by the list.

http://tinypic.com/r/28tawrc/7 - what I get

this is what I have in my "row.xml":

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="left|center" android:minHeight="?android:attr/listPreferredItemHeight"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <ImageView android:id="@+id/icon" android:layout_height="50px"
        android:layout_width="50px" android:minHeight="?android:attr/listPreferredItemHeight"
        android:scaleType="fitXY" android:layout_gravity="center"></ImageView>
    <LinearLayout android:id="@+id/LinearLayout01"
        android:orientation="vertical" android:layout_marginLeft="5dip"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:minHeight="?android:attr/listPreferredItemHeight"
        android:layout_weight="1">
        <TextView android:id="@+id/TextView01" android:text="hi"
            android:textColor="#336600" android:textSize="16dip"
            android:layout_width="fill_parent" android:gravity="center_vertical"
            android:ellipsize="marquee" android:layout_weight="1"
            android:layout_height="fill_parent"></TextView>
        <TextView android:text="hi" android:id="@+id/TextView02"
            android:textColor="#FFFFFF" android:textSize="14dip" android:gravity="top"
            android:lines="20" android:layout_width="fill_parent"
            android:minHeight="?android:attr/listPreferredItemHeight"
            android:layout_height="fill_parent" android:layout_weight="1"
            android:singleLine="false"></TextView>

    </LinearLayout>




</LinearLayout>

How can I get the rest of the text to show?

Jay_EL
  • 69
  • 1
  • 7

1 Answers1

4

Try changing your two android:layout_height="fill_parent" values on your LinearLayouts to android:layout_height="wrap_content". fill_parent does not have much meaning in this situation.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Yes! Thank you! <~ new to developing – Jay_EL Sep 09 '10 at 13:45
  • I am having a similiar problem. I have basically identical xml as above but my text is just going off the side. It's not being contained in the row. So if I have a couple word sentence instead of going to the next line when it reaches the edge it just continues off the side. Any Ideas? – Nick Aug 10 '11 at 13:31