显示不同颜色的字体,可用“font"标记如:
editText2.setText(Html.fromHtml( "<font color=#E61A6B>红色代码</font> "+ "<i><font color=#1111EE>蓝色斜体代码</font></i>" +"<u><i><font color=#1111EE>蓝色斜体加粗体下划线代码</font></i></u>"));
效果如下图:
Powered by: 博客园 Copyright © 2024 slider Powered by .NET 8.0 on Kubernetes