2010-05-27 134 views

回答

0

不要这么想,但如果您只希望文本使用一行,您可以阅读here以正确处理它。

0

退房this话题

...您可以创建TextView2的文字大小喷漆的对象,并使用BREAKTEXT()来衡量多少个字符将适合你的TextView2的宽度......

它为我

6

您可以使用方法:getEllipsisCount

public static boolean isTextTruncated(String text, TextView textView) 
    { 
     if (textView != null && text != null) 
     { 

      Layout layout = textView.getLayout(); 
      if (layout != null) 
      { 
       int lines = layout.getLineCount(); 
       if (lines > 0) 
       { 
        int ellipsisCount = layout.getEllipsisCount(lines - 1); 
        if (ellipsisCount > 0) 
        { 
         return true; 
        } 
       } 
      } 

     } 
     return false; 
    } 

我发现下面的相关职位的答案:

Check if textview is ellipsized in android

+0

感谢lot..helped我很多.. – AndroidMech 2015-06-26 11:58:11

+1

什么用PARAM字符串text'的'? – 2017-11-09 05:15:04

相关问题