
1551685057(1).png
一般我們給TextView設置內(nèi)容的時候會使用下面方式:
textview.setText("constr")
其實setText方法還有個兩個參數(shù)的方法:
public void setText(CharSequence text, BufferType type) {
setText(text, type, true, 0);
if (mCharWrapper != null) {
mCharWrapper.mChars = null;
}
}
如果使用一個參數(shù)的方法時系統(tǒng)內(nèi)部默認會將的BufferType設置成默認的BufferType.NORMAL;
要解決表情顯示不完整的問題我們可以設置BufferType為BufferType.SPANNABLE, 即:
textview.setText("constr", BufferType.SPANNABLE) ;