"Ellipse" shows only one point

On my Samsung Galaxy Nexus, the behavior is fine, it shows three dots, but on Samsung S2 only one dot is displayed. There is only one layout file:

<TextView android:id="@+id/textViewOfferTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@+id/textViewRedemptionDate" android:layout_alignParentLeft="true" android:ellipsize="end" android:singleLine="true" android:textColor="@color/pontai_dark_gray" android:textSize="@dimen/ndp_font_size" /> 

This is an example:

http://img109.imageshack.us/img109/5118/96452147.png

Has anyone seen this?

+7
source share
2 answers

remove

 android:singleLine="true" 

and try

 android:lines="1" android:ellipsize="end" 

This works for me.

+2
source

There is no guarantee how the text will be ellipse (one dot is a bit misleading if you ask me, but it can be interpreted as a shorthand). If you want to provide three-point behavior, you can subclass TextView and add your own behavior. An example can be seen in this SO question (just don't worry about the "multiple lines" part of the code). In short, one dot for ellipsis should not be a problem.

0
source

All Articles