I have the following code, which is the basis for the list.
The idea is to have a checkbox that always aligns to the right of the screen. If the text to the left of it is too long, I would like it to be elliptical "..." or cut gracefully.
It works fine while the text is short, but not the same as the text is long. Any tips?
<?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>
source
share