Ellipsize attribute not working on Android 4.0

I am currently testing an application on Android 4.0 Ice Cream Sandwich before releasing the update to the market. During the tests, I realized that the ellipsize attribute stops working.

I used it as a list to trim the headers of elements that were long. On Android 2.3.7, everything looks as expected. Headings that are too long are truncated, and three dots are added to the end of the line. In Android 4.0, the title simply truncates after the last word, which fits on the screen, and the rest is skipped.

I tested it on Android 2.3.7 and Android 4.0.3. You can even test this behavior in eclipse by changing the version of Android in the graphics editor.

Someone has the same problem. Any work in this round?

+3
source share
3 answers

android:singleLine="true" works for me.

+8
source
 enter code here <TextView android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:lines="1" android:ellipsize="marquee" android:fadingEdge="horizontal" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:textColor="#ff4500" android:text="Om Namah Shivaya : Om Namah Shivaya : Om Namah Shivaya : Om Namah Shivaya : Om Namah Shivaya" android:layout_marginTop="2dp"> <requestFocus android:duplicateParentState="true" android:focusable="true" android:focusableInTouchMode="true" /> 

0
source

I can recall that I had a similar problem, and I could solve it by setting the Texttext (with an attribute with an ellipse attribute) to left . But, most likely, this is another problem.

-1
source

Source: https://habr.com/ru/post/1389423/


All Articles