Android: TextView automatically truncate and replace last 3 char of String

You should be able to use the “ellipsize” property of a text view:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/text_mytext"
    android:ellipsize="end"
    android:maxLines="1"
/>

You may also need to apply gravity values to the layout too; I have sometimes seen “auto-stretching” views without them.

Leave a Comment