0

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 ?

MikeyBoy
  • 25
  • 4

2 Answers2

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
0

Hope this might be helpful:Click here

Chintan Soni
  • 24,761
  • 25
  • 106
  • 174