私はテーブル内の行間に区切り線が必要であるという点で1つのテーブルレイアウトを表示しています。また、テーブルレイアウトで列方向の分離をすることも可能です。テーブルレイアウト内の行間の分離
私のXML表のレイアウトを以下に示します。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="6dip"
android:paddingTop="4dip">
<TableLayout
android:id="@+id/tablelayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="2dip">
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Income"></TextView>
<TextView
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="150dp"
android:text="Expense"></TextView>
</TableRow>
<TableRow android:layout_marginTop="30px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Household:"></TextView>
<TextView
android:id="@+id/text50"
android:layout_width="150px"
android:layout_height="wrap_content"
android:text="Household:"></TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:text="Travel:"></TextView>
<TextView
android:id="@+id/text51"
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="-250dp"
android:text="Travel"></TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:text="Education:"></TextView>
<TextView
android:id="@+id/text52"
android:layout_width="150px"
android:layout_height="wrap_content"
android:layout_marginLeft="-250dp"
android:text="Education"></TextView>
</TableRow>
</TableLayout>
</LinearLayout>
uは表の行2のテキストを追加しているように、一つの画像(行)を追加/幅2dp.thisを有するテキストとの間の分圧器としてビューはまた、これを試みることができる分圧器 – AkashG
として機能します。 http://stackoverflow.com/questions/2108456/how-can-i-create-a-table-with-borders-in-android または http://stackoverflow.com/questions/7117533/how-to-give-border-of-cells in-tablelayout-in-android – spr