Paresh Mayani
Paresh Mayani

Reputation: 128428

TextView should be displayed with ... character at the end

i have created a textview with the below code:

<TextView 
    android:id="@+id/txtDescription" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:textSize="16dip"
    android:textStyle="bold"
    android:maxLines="5">

As above, i have set the 5 Lines as maximum for the textview.

But my doubt is: if the string which i am going to display in Textview if it exceeds 5 lines, then it will be fitted upto 5 lines ending with "..." characters.

e.g.

Hello this is the demo of 
string which i have 
created especially for
the demo of textview
and setting maximum...

As same as above, i want to display in TextView output.

Pls give me suggestion, code or any link.

Thanx

Upvotes: 0

Views: 557

Answers (1)

Kevin Coppock
Kevin Coppock

Reputation: 134664

Just use android:ellipsize.

Upvotes: 1

Related Questions