Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ellipsize - start not working in TextView

I have a textView as follows:

<TextView
    android:id="@+id/pointsTextView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/pointTextView"
    android:ellipsize="start"
    android:lines="2"
    android:paddingEnd="5dp"
    android:paddingStart="5dp"
    android:text="this is a very very very very very very very very very very very very very very very very very very very very very long sentence." />

Here ellipsize="end" is working perfectly, but ellipsize="start" is not wroking when no of lines is not 1.

How can I make this work in such TextView with 2 or more no of lines?

like image 572
Nabin Bhandari Avatar asked Dec 23 '22 17:12

Nabin Bhandari


1 Answers

If you want to use android:ellipsize="start" with android:maxLines="2" (more than one), then it's not possible in android (since API level 1).

If setMaxLines(int) has been used to set two or more lines, only END and MARQUEE are supported (other ellipsizing types will not do anything).

See the documentation here

like image 76
Ronak Thakkar Avatar answered Jan 14 '23 03:01

Ronak Thakkar