Spannalbe
This is the interface for text to which markup objects can be attached and detached. Not all Spannable classes have mutable text; see Editable for that.
setSpan方法:
public abstract void setSpan (Object what, int start, int end, int flags)
Since: API Level 1
Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere. See Spanned for an explanation of what the flags mean. The object can be one that has meaning only within your application, or it can be one that the text system will use to affect text display or behavior. Some noteworthy ones are the subclasses of CharacterStyle and ParagraphStyle, and TextWatcher and SpanWatcher.
前两天同样遇到这个问题,后来解决了,使用Spannable即可搞定。
这里有一个参考案例:
原文链接:http://lovezhou.iteye.com/blog/905446
Spannalbe文档:
setSpan方法:
http://developer.android.com/referenc...