A text view that does not display full text

I am creating a simple layout with TableLayout and TableRow that contain two TextViews. This is part of the code.

<TableLayout 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:stretchColumns="0">

    <TableRow android:id="@+id/myTableRow">

    <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:padding="15dip"
        android:text="Short description"/>

    <TextView 
        android:id="@+id/textView1"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:padding="15dip"
        android:text="Large description"/>

    </TableRow>

The problem is that if there is long text in TextView1, then the full text is not displayed. How to show full text in TextView1?

+3
source share
2 answers

Try updating the XML that you gave in question ... maybe this is what you wanted to do.

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <TableRow android:id="@+id/myTableRow" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="15dip"
            android:text="Short description" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:padding="15dip"
            android:text="Large description" />
    </TableRow>

</TableLayout>
+3
source

to display multiple lines add:

android:ellipsize="none"// the text is not cropped to the width of the text:

android:scrollHorizontally="false"   //the text wraps on as many lines as necessary: 
+2
source

All Articles