I want to set TextView max line 2 and show “…” in the line middle.
My layout xml as below:
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="abcdefghijklmnopqrstuvwxyz"
android:ellipsize="middle"
android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge" />
But it show as below:
abcdefgh
ijklmnop
It show 2 lines, but it doesn’t show any “…” at middle or end.
How can I modify it?
Try to set
android:ellipsize="end".