博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spannable 和 Editable、SpannableString 和 SpannableString
阅读量:4068 次
发布时间:2019-05-25

本文共 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/

你可能感兴趣的文章
AngularJS2中最基本的文件说明
查看>>
从头开始学习jsp(2)——jsp的基本语法
查看>>
使用与或运算完成两个整数的相加
查看>>
备忘:java中的递归
查看>>
Solr及Spring-Data-Solr入门学习
查看>>
python_time模块
查看>>
python_configparser(解析ini)
查看>>
selenium学习资料
查看>>
<转>文档视图指针互获
查看>>
从mysql中 导出/导入表及数据
查看>>
HQL语句大全(转)
查看>>
几个常用的Javascript字符串处理函数 spilt(),join(),substring()和indexof()
查看>>
javascript传参字符串 与引号的嵌套调用
查看>>
swiper插件的的使用
查看>>
layui插件的使用
查看>>
JS牛客网编译环境的使用
查看>>
9、VUE面经
查看>>
关于进制转换的具体实现代码
查看>>
Golang 数据可视化利器 go-echarts ,实际使用
查看>>
mysql 跨机器查询,使用dblink
查看>>