0

1つのtablerowとlayout_weightのweightsumを定義しました。これは私がしていることです

 <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:weightSum="1" >

            <TextView
                android:id="@+id/add"
                android:layout_width="fill_parent"
                android:layout_height="45dp"
                android:layout_weight="0.2"
                android:text="@string/restaurant_add"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/Restaurant_add"
                android:layout_width="fill_parent"
                android:layout_height="45dp"
                android:layout_weight="0.8"
                android:clickable="true" />
        </TableRow>

データをRestaurant_addに動的に入力していますが、Restauant_addにデータを入力すると、layout_weightを0.8に設定していても、android:text = "@ string/restaurant_add"に存在するデータが上書きされます。

私がしている間違いは何ですか?

ありがとう:)

4

2 に答える 2

0

android:layout_width="0dp"2 つの TextViewに設定してみてください。

また、TextView の ID Restaurant_add は、文字列 @string/restaurant_add と同じです。文字列ではなく、必ずレイアウトを変更してください。

于 2013-03-21T13:44:35.823 に答える
0

両方の android:layout_widths を「0dp」に設定します。

于 2013-03-21T13:49:19.577 に答える