Android Tips: cut textview to see ‘…’ (ellipsis)

Android tips: cut textview and add ellipsis

Single line

Add android:ellipsize=”end” in the properties of the texview.

If you want your text on one line, add android:singleLine=”true”.

Example:

<TextView
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:text="Text to cut because it is too long"
  android:ellipsize="end"
  android:singleLine="true"
/>

Multi lines

If your textview will be on 2 lines for example, add Continue reading