android 在文本视图 _EDIT 末尾附加 '...' [英] android append '…' at the end textview _EDIT

查看:28
本文介绍了android 在文本视图 _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

我使用的完整代码:

<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"

/>我得到的输出是:

一个更智能的星球究竟会是什么样子
看起来像?IT如何变化?一个...

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 在文本视图 _EDIT 末尾附加 '...'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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