我有三列,我想垂直对齐。列的数据使用对象检索,然后使用layoutflator显示。使用自定义适配器/ layoutinflator时,垂直对齐textview列
目前列已遍布各地。我希望让他们完美对齐。我正在使用文本视图,但我开始怀疑我是否不应该使用某种表格布局。
下面是XML:
机器人:ID = “@ + ID/table_layout” 的xmlns:机器人=“http://schemas.android.com/apk/ RES /机器人” 机器人:layout_width = “FILL_PARENT” 机器人:layout_height = “FILL_PARENT” >
<ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" /> <TableRow android:id="@+id/row_multi_row" > <TextView android:id="@+id/item1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:padding="3dip" android:layout_weight="1" /> <TextView android:id="@+id/item2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:padding="3dip" android:layout_weight="1" /> <TextView android:id="@+id/item3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:padding="3dip" android:layout_weight="1" /> </TableRow> </TableLayout>
文本的意见没有被设置为'fill_parent',从而为他们的需要,他们将永远只能拿那么多房间。 – Matthias 2012-03-21 11:50:11