4

TableLayout を使用してデータを表示しています。アクティビティが onCreate() を呼び出すと、右側の列の TextViews のテキストが設定されます。

さて、次の画像でわかるように、住所テキストは長くなる可能性があり、折り返す必要があります。だから私は設定しandroid:layout_width="wrap_content"ました。ただし、データをラップするには画面サイズの幅が必要です。どうすればこの問題を克服できますか?

代替テキスト

私のxml:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5px">
    <TableRow>
        <TextView android:text="Job#"
            android:paddingRight="5px" />
        <TextView android:id="@+id/DetailJobNo" />
    </TableRow>
    <TableRow>
        <TextView android:text="Address"
            android:paddingRight="5px" />
        <TextView android:id="@+id/DetailAddress"
            android:layout_width="wrap_content"
            android:text="Address Address Address Address Address Address Address Address "/>
    </TableRow>
</TableLayout>
4

3 に答える 3

6

android:shrinkColumns="1"TableLayout に追加すると、私の問題が解決します。

于 2011-01-07T07:30:03.000 に答える
0

setHorizo​​ntallyScrollingDetailAdressTextView に falseに設定してみてください。

于 2011-01-07T07:30:49.187 に答える