如果检测TextView的跨越2线TextView

由网友(岁月流逝不再回首)分享简介:我不知道是否有发现任何方式或者如果字符串被安装到一个文本视图达到画面的结束,因此换线,或者如果一个TextView跨越了两行?I wonder if there are any ways to detect either if string to be fitted into a text view reaches...

我不知道是否有发现任何方式或者如果字符串被安装到一个文本视图达到画面的结束,因此换线,或者如果一个TextView跨越了两行?

I wonder if there are any ways to detect either if string to be fitted into a text view reaches the end of screen and therefore change line, or if a textview spans over 2 lines?

我想知道这个,所以我可以增加一些textviews之间的利润率,如果一个TextView跨越了2行,我当然要动态地做到这一点。

I want to know this so I can increase margins between some textviews if a textview spans over 2 lines, of course I want to do this dynamically.

推荐答案

的TextView 支持 getLineCount() - 请参阅docs小心,因为你可能需要检查的观点得到了第一个绘制。

TextView supports getLineCount() - See docs careful as you may need to check if the view has been drawn first.

阅读全文

相关推荐

最新文章