I created a text view as follows:
<TextView android:id="@+id/TextView_top" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="10dp" android:layout_marginTop="5dp" android:ellipsize="end" android:maxLines="3" android:textColor="@color/white" android:textIsSelectable="false" android:textSize="14sp" />
The text inside is set programmatically using the layout inflator, the text coming from an XML feed. I checked the source and there were no random characters or line breaks.
Testing this TextView on a Nexus 4 running Android 4.3. I see strange behavior.
String inside the ends: "Lorem ipsum dolor sit amet"
In Nexus, this is truncated in the right place, but instead of ending with the ellipsis symbol, like: "dol ...", I get "dol ... s" with the final half-hidden character breaking through the border.
Increasing the field then gives me "ipsum ... dol" at the end.
I tested this on my other Galaxy S3 test devices running 4.1.2, and Desire C is running 4.0.3, and not on them.
Has anyone else seen this behavior with an ellipsis: end? Any suggestions on what I could have done wrong or how can I get around this?
android textview
Keab42
source share