I'd like to show the text like the below...
My coding is the following:
SpannableString sText = new SpannableString(text);
sText.setSpan(new BackgroundColorSpan(Color.YELLOW), 0, sText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
holder.txtText.setLineSpacing(0, 1.5f);
textView.setText(sText);
It has been a long time but I'll put the static method below. Hopefully it will help another.
Usage :
I'm sure you'll manage to modify according to your needs.
You can use
lineSpacingExtra
orlineSpacingMultiplier
in your XML file. You can find it here: http://developer.android.com/reference/android/widget/TextView.html#attr_android%3alineSpacingExtraAnd for background color you can use:
try this. Create custom TextView and override method draw(Canvas canvas).