Tutorial by Examples

In the following example, we create an Activity to display a single TextView. The TextView will use a SpannableString as its content, which will illustrate some of the available styles. Here' what we're gonna do with the text : Make it larger Bold Underline Italicize Strike-through Colored...
Method: setSpanColor public Spanned setSpanColor(String string, int color){ SpannableStringBuilder builder = new SpannableStringBuilder(); SpannableString ss = new SpannableString(string); ss.setSpan(new ForegroundColorSpan(color), 0, string.length(), 0); builder.append(ss); ...

Page 1 of 1