This question is a follow up to my last question: How to highlight text like Android spell-checker?
I'm using an UnderlineSpan to underline text in an EditText but I need the underline to be IN COLOR like this screen shot of the spelling checker:
Unfortunately, you can't do this solely with a Span -- there are no public methods to do what you ask. There is a method to set the underline color in TextPaint independent of the text color (you can see it in the source code for SuggestionSpan) but it's hidden.
If you can get access to the EditText, you can handle the Span and draw the underline yourself, but otherwise you are out of luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With