7

I've used ClickableSpan on a TextView. Upon adding the span, the color of text where it has been applied was changed too.

Checking SO questions, what I've seen are changed color after it was clicked. In my case, the color is already different upon rendering the view.

How can I remove the color from the ClickableSpan?

sticky
  • 383
  • 1
  • 4
  • 19
  • You can avoid using clickable span and just make TextView is clickable or using borderless button could be a good approach – Emre Aktürk May 18 '17 at 17:21

1 Answers1

12

Clickable span have updateDrawState(TextPaint ds) method. set same color as you text color for clickable span also. so it will look same (2nd Approch)

@Override public void updateDrawState(TextPaint ds) {
    //super.updateDrawState(ds);
    ds.setColor(linkColor);
    ds.setUnderlineText(false); // set to false to remove underline
}
Wasim K. Memon
  • 5,979
  • 4
  • 40
  • 55