【发布时间】:2011-06-16 16:30:03
【问题描述】:
我有以下代码是列表视图的基础。
这个想法是有一个始终与屏幕右侧对齐的复选框。如果左边的文字太长,我希望它是椭圆形的“...”或优雅地切断。
只要文本很短,它就可以正常工作,但当文本很长时就不行。有什么建议吗?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableLayout android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0"
>
<TableRow
android:id="@+id/TableRow01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="This is a very very long title 12345678"
/>
<CheckBox android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout>
</LinearLayout>
【问题讨论】:
标签: android listview checkbox android-layout