views:

2286

answers:

4

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
How to use these ? The text is still truncated to two lines whatever the value that I give them
Arutha
How are you setting it? I think you're missing something but it is hard to guess.
moraes
I used the same settings but my text is always trunked to two lines
Arutha
A: 

Do you have a style or theme that is applied to your TextView, that could be specifying a maximum size?

Mayra
A: 

I've run into this problem, too. There's a rather old bug about it that remains unanswered: Bug 2254

Robert Nekic
Eeeks. You are right. I tried that and could not make a 4-line ellipsis. It breaks always at the second line.
moraes
A: 

I have had the same Problem. I fixed it by just deleting android:ellipsize="marquee"

TianDong