我试图建立和应用,显示组织的数据,所以我想,基本上是TableLayout
将是一个不错的主意,只为让他们在行,所以我不知道什么正确的如何做到这一点?我有这个在我的XMLAndroid的 - 列表视图内tableLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello" >
</TextView>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="233dp"
android:layout_marginTop="44dp" >
</ListView>
</TableRow>
</TableLayout>
</LinearLayout>
那么它只是使TableLayout
标签和TableRow
标签显示,上面写着警告:
"This TableLayout layout or its LinearLayout parent is possibly useless"
所以我的理解是不拾取TableLayout
。我怎样才能解决这个问题?有没有另一种方法来做到这一点easly?
哇人,感谢信息,真正有启发性,我会做到这一点,看看出来,但其他的事情,如果我想添加更多的行后来说从信息在数据库中,最好以编程方式执行或将布局设置为xml文件? – DeX03 2012-02-10 15:17:26
如果你拉出可变数量的行,你别无选择,只能以编程方式来做(因为你没有足够的,否则你会有多余的行)。如果你总是有一定数量(即,你有“每页5个结果”),那么用XML定义它们,你可以使额外的东西不被用作android:visibility =“gone”。 – Graeme 2012-02-10 15:20:31