android text color
Is it possible to have different colored texts within the same text view?
I've been trying to use the Spannable class to style my texts but the documentat开发者_如何转开发ion is completely useless on how to style text with it.
Use Html.fromHtml
, the font
tag and the color
attribute...
String s = "<font color='#FF0000'>I'm read</font> <font color='#0000FF'>and I'm blue</font>";
textView.setText(Html.fromHtml(s));
精彩评论