TextView多种颜色
来源:互联网 发布:淘宝永恒强袭自由高达 编辑:程序博客网 时间:2024/06/03 15:45
给TextView添加多种颜色内容,使用SpannableString 配合SpannableStringBuilders使用
/**
* 给字符串添加颜色,返回SpannableString*
* @param str
* @param color
* @return
*/
public static SpannableString getSpannableString(String str, int color) {
SpannableString spannableString = new SpannableString(str);
spannableString.setSpan(new ForegroundColorSpan(color), 0,
str.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return spannableString;
}
更多http://blog.csdn.net/harvic880925/article/details/38984705
0 0
- TextView多种颜色
- 一个textview多种颜色,或试用html多种颜色
- TextView 文字颜色设置的多种方法
- 一个TextView多种字体颜色,加超链接
- 一个TextView多种字体颜色,加超链接
- Android中TextView多种颜色的设置
- textView中设置多种颜色的文字
- Android Toast自定义 (一个textview多种颜色,或试用html多种颜色)
- android TextView的字体颜色设置的多种方法
- TextView的字体颜色设置的多种方法
- android TextView的字体颜色设置的多种方法
- TextView的字体颜色设置的多种方法
- 【Android基础】TextView的字体颜色设置的多种方法
- android TextView的字体颜色设置的多种方法
- TextView的字体颜色设置的多种方法
- textview设置多种不同的字体颜色和点击事件
- 一个textview里设置多种字体颜色,并添加图片
- TextView设置 多种颜色,封装好的工具类
- iOS 实时卡顿监控
- WINDGB环境配置
- poj3264
- c: stringtoken_s分词函数 ,strftime时间函数,clock计时函数
- java 测试概述
- TextView多种颜色
- iOS 学习日志 : 获取视图所在控制器
- hdu 2028
- Linux系统常见的压缩与打包
- Oracle数据库基础知识
- 用c语言编写的可以计算+-*/的计算器
- RPC(linux)报错 Cannot register service RPC
- wireshark 过滤条件补充!
- 仿网易新闻客户端——BPNews