In my listview i have an image i every row, and some text to the right side of the image. I have two text strings above each other. Is it possible somehow to cut the sentence, in text string one, if it gets too long. Like putting on some limite on how many characters it may contain. If i for example wanted it to say: “Kanye West live this saturday in New Your City”, but then because this sentence gets too long, my second text string disappears. So instead i want it to look like this: “kanye West live this…(cut)”, and then to show the rest You have to tap the row.
So it is possible to cut the sentence, by using some sort of limite on characters?
Hope You understand.
Thanks
In my listview i have an image i every row, and some text to
Share
Yes it’s possible. In the TextView tag, add right margin (to adjust characters number you want) and add also this code :
android:maxLines="2"andandroid:ellipsize="end"This cut your sentence by adding “…” when the right limit of the textView is reached.You obtain something like this for your textView :