I need to ellipsize multiligne textview. My component is large enough to display at least 4 lines with the ellipse, but only 2 lines are displayed. I tried to change the minimum and maximum number of rows in the component but it changes nothing
A:
There are a few attributes you should check: android:lines, android:minLines, android:maxLines. To display a maximum of 4 lines and ellipsize it, you just need android:maxLines and android:ellipsize:
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="marquee"
android:text="Hai!"
/>
moraes
2010-01-29 10:08:03
How to use these ? The text is still truncated to two lines whatever the value that I give them
Arutha
2010-01-29 14:15:04
How are you setting it? I think you're missing something but it is hard to guess.
moraes
2010-01-29 14:44:59
I used the same settings but my text is always trunked to two lines
Arutha
2010-01-29 16:34:08
A:
Do you have a style or theme that is applied to your TextView, that could be specifying a maximum size?
Mayra
2010-01-29 18:36:54
A:
I've run into this problem, too. There's a rather old bug about it that remains unanswered: Bug 2254
Robert Nekic
2010-01-29 20:52:23
Eeeks. You are right. I tried that and could not make a 4-line ellipsis. It breaks always at the second line.
moraes
2010-01-29 21:47:12
A:
I have had the same Problem. I fixed it by just deleting android:ellipsize="marquee"
TianDong
2010-06-02 17:01:34