本文共 1795 字,大约阅读时间需要 5 分钟。
Spanned(可附加标记的字符序列)
** * This is the interface for text that has markup objects attached to * ranges of it. Not all text classes have mutable markup or text; * see {@link Spannable} for mutable markup and {@link Editable} for * mutable text. */public interface Spanned extends CharSequence
Spannable (可加或去除标记的字符序列)
/*** This is the interface for text to which markup objects can be attached and detached. * Not all Spannable classes have mutable text; * see {@link Editable} for that. */public interface Spannableextends Spanned
Editable (内容和标记都可变的字符序列)
/** * This is the interface for text whose content and markup can be changed */public interface Editableextends CharSequence, GetChars, Spannable, Appendable
Appendable(字符文本可改变的接口)
/** * An object to which char sequences and values can be appended. */public interface Appendable
SpannableString (内容不可变,标记可附加或去掉)
/** * This is the class for text whose content is immutable but to which * markup objects can be attached and detached. * For mutable text, see {@link SpannableStringBuilder}. */public class SpannableStringextends SpannableStringInternalimplements CharSequence, GetChars, Spannable
SpannableString只有以下3个方法
public void setSpan(Object what, int start, int end, int flags) { super.setSpan(what, start, end, flags); } public void removeSpan(Object what) { super.removeSpan(what); } public final CharSequence subSequence(int start, int end) { return new SpannableString(this, start, end); }
SpannableStringBuilder(内容和标记都可变)
/** * This is the class for text whose content and markup can both be changed. */public class SpannableStringBuilder implements CharSequence, GetChars, Spannable, Editable, Appendable, GraphicsOperations
SpannableStringBuilder有append,insert, setSpan , removeSpan方法
转载地址:http://zhaji.baihongyu.com/