0
在我的应用程序中,我有1个tablelayout和1个database.Now,我想在表格布局中显示该数据库内容。但它应该看起来像一个listview,因为我必须显示下面的条目另一种。可以在表格布局中使用listview,也可以在表格布局中设置相应列表视图中的数据库条目。Tablelayout中的Listview android
这里是我的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>
感谢Soumyadip Das.But我的要求是我来显示表格式的数据,因为我必须证明两个列表像并排结构的一面。 – Prakash 2012-07-07 09:01:06