1

Is it possible to have a black background around each letter (not for the whole word) in a word in a TextView?

ohadinho
  • 6,484
  • 14
  • 64
  • 120

1 Answers1

3

The only way I can think of is by using html in your textView.

Put your text in HTML and then do something like this

TextView contactWeb1 = (TextView) findViewById(R.id.contactWeb1);
String desc = "<font color=\"red\"><a href='http://www.mysite.com/'>Visit my site</a></font>";
contactWeb1.setText(Html.fromHtml(desc));

The above code is from the 3rd link

Here are some related questions

  1. Is it possible to have multiple styles inside a TextView?
  2. How to display HTML in TextView?
  3. Android Linkify links textColor ignored, css style overrides possible?
Community
  • 1
  • 1
Gautam
  • 7,744
  • 10
  • 62
  • 104
  • I can't use "style" inside that html ? I have tried to "tvText.setText(android.text.Html.fromHtml("bla"));" in order to put black border around each letter but it didn't work. – ohadinho Aug 22 '12 at 12:30
  • I doubt android has a css parser, so try to use only the ancient `` tag – Gautam Aug 22 '12 at 15:42