-1
的项目我要对齐的相应列标题的项目,这里是发生什么事,有没有办法来排列这还是我需要编写它手动感谢如何使Android上的SQLite数据库
Name Hotness
Yan 10
我的XML代码
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow>
<TextView
android:layout_width="fill_parent" //this is my column 1 which Name
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Names" >
</TextView>
<TextView
android:layout_width="fill_parent" //the column 2 which is Hotness
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Hotness" >
</TextView>
</TableRow>
</TableLayout>
<TextView
android:id="@+id/tvSqlInfo" //to save on the database
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="get info" >
</TextView>
</LinearLayout>
我试过你的例子,但它仍然没有对齐 – user1590096
你可能将不得不使用textviews的宽度和大小,然后再将它们添加到你的行中。你也可能需要向行添加布局参数,这意味着你可以用“table.addView(row,l);”替换“table.addView(row)”。 – zabawaba99