【发布时间】:2018-07-05 07:26:16
【问题描述】:
当最后一项超过一行时,您可以看到下一个文本转到下一行,但它不能与上面的文本完全一致。
这是xml:
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Notes"
android:layout_column="1"/>
<TextView
android:id="@+id/txt_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:singleLine="false"
android:layout_weight="1"
android:maxLines="4"/>
</TableRow>
我已经尝试在新的文本视图中设置冒号,但没有。
所以我尝试在 java 中添加冒号和 setText, 这是java类:
orderListViewHolder.txtDate.setText(": "+itemOrderList.get(position).getDate());
orderListViewHolder.txtOrderNumber.setText(": "+itemOrderList.get(position).getOrderNumber());
orderListViewHolder.txtCustomerName.setText(": "+itemOrderList.get(position).getCustomerName());
orderListViewHolder.txtProductStatus.setText(": "+itemOrderList.get(position).getProductStatus());
orderListViewHolder.txtNotes.setText(": "+itemOrderList.get(position).getNotes());
如何精确对齐这些项目?
【问题讨论】:
标签: android android-tablelayout