Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TextView

I have an Android TextView where the view itself is limited to four lines. If the text exceeds this limit I want the end of the view to end with something like .. <-- to notify that there is more text here so you can click and open in fullscreen for example. Not just suddenly stop in the middle of a sentence. Is there a quick fix for this?

like image 844
KimHafr Avatar asked Oct 14 '22 05:10

KimHafr


2 Answers

Use the android:ellipsize="end" attribute in your layout XML file. It may still stop in the middle of a sentence, but it will have an ellipsis (...) at the end.

like image 149
CommonsWare Avatar answered Oct 18 '22 15:10

CommonsWare


Go to the layout file which contains this textview and place following attribute

android:ellipsize="end"

There are 4 options. start, end, middle or marquee. Since you want dots at the end use "end" value

like image 23
WBis Avatar answered Oct 18 '22 13:10

WBis