Hi there is there a way that in my textview I can make the text in my textview more than one different color? Like some of the text color is green and the other part is red ?
Asked
Active
Viewed 113 times
2 Answers
2
Text in my textview more than one different color
TextView textView = (TextView)findViewById(R.id.textView);
String text = "<font color='green'>Green</font><font color='red'>Red</font>.";
textView.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE);

Ajay S
- 48,003
- 27
- 91
- 111
-
-
@MikeyBoy I have removed the space between them in above code now try it. – Ajay S Feb 24 '13 at 13:04