SimpleUser
SimpleUser

Reputation: 13

Android wordwrap in TableLayout

I am trying to make a TableLayout for the Android but I cannot get the wordwrap to work. What I want is that the data in the third column will fit in multiple lines. But what I get is that the data of the last column will disappear of the screen

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

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

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

            <TextView android:text="1" />
            <TextView android:text="aaa" />
            <TextView android:text="AAAAA AAAAA AAAAA AAAA AAAAA AAAAA AAAA" />
        </TableRow>

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

            <TextView android:text="2" />
            <TextView android:text="bbb bbbb bb" />
            <TextView android:text="BBBB BBBB BBB BBB BBB BBB BBBB BBBBB BB" />
        </TableRow>
    </TableLayout>

</ScrollView>

Upvotes: 1

Views: 1201

Answers (1)

waqaslam
waqaslam

Reputation: 68187

try using android:shrinkColumns="2" in your TableLayout

Upvotes: 1

Related Questions