目前我正在開發一些android
應用程序,其中包含list
。 我已經在移動(手機)設備中製作了一個。 ,我想在平板電腦(7「-10」)顯示屏上顯示responsive
。所以header
和column
看起來與移動顯示器相同。如何使TableLayout響應
這裏是5" 和7" 顯示之間,差別很大:
這是我當前的XML代碼
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:tag="reqtag"
>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:showDividers="beginning|end"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Date"
android:id="@+id/tvClaimDateReimbursementRequest"
android:layout_marginRight="50dp"
android:textSize="12dp"
android:width="100dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Type"
android:textSize="12dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:id="@+id/tvTypeRequestReimbursement"
android:width="80dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Amount"
android:textSize="10dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:width="100dp"
android:id="@+id/tvAmountReimbursementRequest" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Status"
android:textSize="12dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:id="@+id/tvStatusReimbursementRequest" />
</TableRow>
</TableLayout>
我已經看到這裏的文檔https://developer.android.com/guide/practices/screens_support.html
但我還是不明白, 是否有任何最佳做法來做這樣的事情?
感謝
變化的線性佈局表:我想補充一個父linenar佈局(垂直)和內:線性佈局(垂直)和下這個線性佈局,recyclerview。 Stas Melnychenko說,爲了讓它響應,使用重力。刪除邊距,提供更大的文本大小,並使用strings.xml添加文本:不要對文本進行合併,如果需要維護代碼,則無用。 – Jaco