Android的追加'...'结尾的TextView _EDIT [英] android append '…' at the end textview _EDIT

查看:268
本文介绍了Android的追加'...'结尾的TextView _EDIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个观点lsit和我,我需要添加一些文字。
在适配器,我需要追加......在最后,我用下面的
当我给

I have a lsit view and i that i need to add some text. in the adapter, I need to append ... at the end and i used the following when i give

android:ellipsize="end"

在只能说明2号线
例如:结果
asdnfsdfdsf asdfsdfasdf结果
sdfsd sdfsdf sdfsd广告...

in the only shows 2 line eg:
asdnfsdfdsf asdfsdfasdf
sdfsd sdfsdf sdfsd ad...

当我给

android:ellipsize="start"

这是因为:结果
asdnfsdfdsf asdfsdfasdfd结果
... sdfsd sdfsdf sdfsd广告

it is as :
asdnfsdfdsf asdfsdfasdfd
...sdfsd sdfsdf sdfsd ad

完整code,我用:

<TextView  android:layout_width="wrap_content" android:background="#016A7D"

   android:layout_height="80dp" android:textColor="#000000"

    android:maxLines="4"          

    android:id="@+id/list_report_desciption" 

    android:ellipsize="end"

/>
我得到的输出是:

/> And the output i got is:

究竟将智慧地球的结果
  看起来像?最近怎么变化?一个...

What exactly will a smarter planet
look like? How's IT changing? A...

实际上它包含了超过6行结果
是否有我需要设置,这样我需要得到3行的任何事情结果
谢谢

actually it contains more than 6 lines
Is there any thing i need to set so that i need to get 3 lines
Thanks

推荐答案

没有什么工作对我来说:-(结果
我只是固定的长度。之后切串在长度和追加'...'。结果
现在,它为我工作。

Nothing worked for me:-(
I just fixed the length. Cut the string in that length and append '...' after that.
Now its working for me.

这篇关于Android的追加'...'结尾的TextView _EDIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆