私のアプリケーションには、1つのテーブルレイアウトと1つのデータベースがあります。今、そのデータベースのコンテンツをテーブルレイアウトに表示したいのですが、エントリを上下に表示する必要があるため、リストビューのように見えるはずです。テーブルレイアウト内のリストビューは、テーブルレイアウトの対応するリストビューにデータベースエントリを設定する方法についても考えています。
これが私のXML構造です:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="fill_parent" >
<TableLayout
android:id="@+id/tablelayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingRight="2dip" >
<TableRow>
<TextView
android_layout_span="2"
android:layout_weight="1"
android:text="Income" />
</TableRow>
<TableRow>
<TextView
android:layout_weight="1"
android:text="Price:"/>
<TextView
android:layout_weight="1"
android:text="Price:" />
<ListView
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
</ListView>
</TableRow>
<TableRow>
<TextView
android:layout_weight="1"
android:text="Quantity:"/>
<TextView
android:id="@+id/et_url"
android:layout_weight="1"
android:text="Quantity:" />
</TableRow>
</TableLayout>
</ScrollView>