Android TextView 椭圆大小以 unicode 表情符号结尾

Android TextView ellipsize end with unicode emoji

我有一个带有 TextView 的列表项。 TextView 也可以包含一些 unicode 表情符号,但是当我说 android:ellipsize="end" 时,其中一个表情符号可能会被剪切,并且会有一个带有 '?' 的正方形。

如何防止切割 unicode 代码?

这是我的布局文件:

<TextView
    ...
    android:ellipsize="end"
    android:lines="1"
    ... />

试试这个。或许对你有帮助。

android:singleLine="true"
android:ellipsize="marquee" 
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" 
android:focusable="true" 
android:focusableInTouchMode="true