0
我在我的TableRow
中有兩個TextView
,但其中一個文本很大。我想第一TextView
浮到TableRow
頂部:將TextView浮動到TableRow的頂部
<TableRow
android:id="@+id/trLocation"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/location"/>
<TextView android:layout_width="wrap_content"
android:textSize="50dp"
android:layout_height="wrap_content"
android:text="1234"
android:id="@+id/tvLocation"
android:layout_weight="1"
/>
</TableRow>
我嘗試使用layout_gravity
和gravity
,但他們都沒有任何效果。
這將引入一定的冗餘度。當我改變文字大小時,我還必須更改兩個'layout_height'。 –
如果您使用dim.xml來設置數字值(如textSize),則不需要在兩處進行更改 –