一、富文本显示
1、用xml实现
ex:
appToast.setText(Html.fromHtml(“共<font color=yellow>”+ size()+ “</font>个软件,有<font color=yellow>”+Update + “</font>有更新”));
ex:
String parenName =entity.getParent().getMember_nickname();
parantNameRich =“<font color=’#ff82ab’>” +parenName +“</font>” ;
holder.parentETV.setText(Html.fromHtml(parantNameRich+“: “ +parenString));
注: html的解释 是全部一起来的 parantNameRich+ “: “ + parenString
2、用 SpannableString 实现
ex:
TextView tv= (TextView) findViewById(R.id.tv);
SpannableString sp = new SpannableString(“输入物件名称,例如 “某某””选择SG””);
// 设置样式一
sp.setSpan(new ForegroundColorSpan(0xff009eff)
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!