私はデータを表示するためにTableLayoutを使用しています。 アクティビティがonCreate()を呼び出すときに、右側の列のTextViewのテキストが設定されます。Android TableLayoutの幅の問題
ここで、私のアドレステキストが長くなる可能性があり、それをラップする必要があることがわかります。 だから私はandroid:layout_width="wrap_content"
と設定しました。それでもデータをラップするには画面サイズの幅が必要です。 この問題を解決するにはどうすればよいですか?
私のxml:TableLayoutにandroid:shrinkColumns="1"
を追加
<?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>
あなたの問題を解決したようです。乾杯、indyfromoz – indyfromoz