Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TextView text overflow indicator?

Tags:

android

I was wondering if there is a way to replace the last three characters of a TextView with '...' but only if the current text overflows the TextView. I have to limit the TextView to 1 line but sometimes the text is too long and I would like to show '...' at the end to indicate the text is longer than what is showing.

Thanks

like image 727
Bryan Avatar asked Jun 28 '11 18:06

Bryan


1 Answers

Yes. You can use http://developer.android.com/reference/android/widget/TextView.html#attr_android:ellipsize to configure the display of the "...".

like image 63
Nick Campion Avatar answered Sep 28 '22 15:09

Nick Campion