I have something like a message system and listview that hold the messages.So I want to show let's say only the first 10 symbols of the message and after ellipsis.I couldn't find information how to do it, so if somebody can help me.
Asked
Active
Viewed 226 times
1 Answers
0
I assume you know how to set up an adapter.
You can achieve that by editing your XML layout file. You limit the max amount of text your TextView can hold, and tell it to add ellipsis if it's longer.
<TextView
android:id="@+id/secondLineTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:maxLength="10"
android:ellipsize="end"/>
Example from here
-
This is my xml, maxLenth is working but ellipsize="end" is not working, is not adding ellipsis.Any idea why?Sorry I dont know how to format the code that's why I wrote it and as a answer. – emili Oct 07 '14 at 15:27