我想创建一个包含自定义表行的表格布局。这些行应该像iPhone iBooks书架一样:
我认为最简单的方法是创建具有自定义行的表格布局,这些行具有像一个书架一样的图像。这应该在xml中完成,我对此没有太多经验。然后通过编码我会预订图像。
但我是编程android的新手,所以如果有更简单的方法请告诉我。
所以也许有人可以给我教程或解释如何做到这一点。 现在我有这个:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</RelativeLayout>
感谢。
答案 0 :(得分:0)
是的,
如果数据有限,则可以使用TableLayout。如果您使用的是TableView,那么最简单的方法是将Image作为表格行的背景。
或
如果有很多数据,那么你可以使用ListView和ListView的earch行,你可以设置该图像的背景。
享受。 :)
保持结合。 。 。