开发者

How to set long text in a textview with a continuation mark at the end of the textview

I have a textview with fixed height. I want to s开发者_C百科et a long text, but text comes at the last line getting cut by half, I want to avoid it and want to show a continuation symbol. I am giving an image here, I wan to achieve it like in the image.

How to set long text in a textview with a continuation mark at the end of the textview


Use the ellipsize attribute of TextView. By setting :

  <TextView
        ....
        android:ellipsize="end">
  </TextView>

if the text is longer than your TextView you will have dots(...) at the end of the TextView.


Two line of string only possible to do like this. set ellipsize = end in text view properties.


you should use \n and special symbols from google code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜