
一般我们给TextView设置内容的时候会使用下面方式:
textview.setText("constr")
其实setText方法还有个两个参数的方法:
public void setText(CharSequence text, BufferType type) {
setText(text, type, true, 0);
if (mCharWrapper != null) {
mCharWrapper.mChars = null;
}
}
如果使用一个参数的方法时系统内部默认会将的BufferType设置成默认的BufferType.NORMAL;
要解决表情显示不完整的问题我们可以设置BufferType为BufferType.SPANNABLE, 即:
textview.setText("constr", BufferType.SPANNABLE) ;
网友评论