开发者

TextView in List is cut off

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/T开发者_高级运维extView01" 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜