简体   繁体   English

TextView缩小和省略号问题

[英]TextView shrinking and ellipsis issue

I have a TextView in my layout. 我的布局中有一个TextView。 I just wanted to make its text with this properties: 我只想使用以下属性使其文本:

Singleline - Yes
Shrinking - Yes
Ellipsis - No

My problem is when I set the textview as singleline, it automatically has an ellipsis property. 我的问题是,当我将textview设置为单行时,它会自动具有省略号属性。

There's not really a way to do it with XML alone; 仅使用XML并没有真正的方法。 you have to do it after the XML has been inflated by calling textView.setEllipsize(null); 您必须在XML膨胀后通过调用textView.setEllipsize(null);

You habe to change the property once the view is drawn. 绘制视图后,您可以更改属性。

For ex- tv.setEllipsize(null); 对于ext.setEllipsize(null);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM