Reputation: 2964
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?
Upvotes: 5
Views: 1955
Reputation: 49
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
Upvotes: 1
Reputation: 1006744
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.
Upvotes: 3