【发布时间】:2012-02-10 14:28:45
【问题描述】:
我正在尝试构建和显示有组织的数据的应用程序,所以我认为基本上 TableLayout 将是一个好主意,只是将它们保持在行中,所以我想知道正确的方法是什么它?我的 xml 中有这个
<?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。我怎样才能解决这个问题?有没有其他方法可以轻松做到这一点?
【问题讨论】:
标签: android android-layout android-listview android-ui android-tablelayout