Android的TextView中设置ellipsize为end之后依然有字符的问题

这个可能是由于text中有换行符,导致的bug。

替换掉 换行符即可。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
text = text.replace('\n',' ');
text = text.replace('\n',' ');
text = text.replace('\n',' ');  

 

Leave a Reply

Your email address will not be published. Required fields are marked *