简体   繁体   中英

multiline ellipsis in textView - is this a known bug?

I want to display only 6 lines in my TextView and anything more i would like to ellipsise that.

So, i did

<TextView android:id="@+id/text" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_alignParentLeft="true"
    android:layout_centerVertical="true" android:paddingLeft="20dip"
    android:paddingRight="40dip" android:textSize="18dip"
    android:paddingBottom="5dip" android:paddingTop="5dip"
    android:maxLines="6" 
    android:ellipsize="marquee" 
    android:singleLine="false"
    />

This TextView is part of my list row contents. I have a custom adapter for the listView.

The issue is that i do not see the ellipsis "..." at the end of the 6th line as i had expected. If i remove android:maxLines="6" and set android:singleLine="true", then i do see the "..." at the end of the first line. So, why does not the marquee work if the number of line is more than one?

Is this a known bug? If yes, any workaround? I even tried setting the setSelected(true) on the textView in the java file. Still no workie.

I am working on HoneyComb 3.1 SDK.

It looks like this is an old bug: Issue 2254 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM