检查弹出窗口中是否显示字符串

时间:2016-10-13 12:05:14

标签: java android string popupwindow

有没有标准的方法来做到这一点?我的弹出窗口有maxsize,如果太长,我想剪断字符串。 目前我正在做

   if(txt.length()>320)
        {
            txt = txt.substring(0,320)+"...";
        }

但这似乎很粗糙,有时因为段落而无效。

1 个答案:

答案 0 :(得分:3)

您可以将以下属性定义为textview。

  

机器人:ellipsize = “结束”

相关问题