开发者

How to show ... at the end of string if it doesn't fit 1 line in TextView?

开发者 https://www.devze.com 2023-03-08 15:43 出处:网络
I use android:maxLines=\"1\"开发者_运维百科 right now but I\'d rather have \"...\" at the end of this line. Preferably fading off. Is it possible with TextView?Not only possible, but built into the fr

I use android:maxLines="1"开发者_运维百科 right now but I'd rather have "..." at the end of this line. Preferably fading off. Is it possible with TextView?


Not only possible, but built into the framework.

The XML flag for the TextView is android:ellipsize, and the related TextView method is setEllipsize.

0

精彩评论

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