Change the text color of a single ClickableSpan when pressed without affecting other ClickableSpans in the same TextView

后端 未结 8 1324
小鲜肉
小鲜肉 2020-11-29 21:19

I have a TextView with multiple ClickableSpans in it. When a ClickableSpan is pressed, I want it to change the color of its text.

I have tried setting a color state

8条回答
  •  猫巷女王i
    2020-11-29 22:11

    The answer by Steven M above works, but thought I'd share this: https://github.com/saket/Better-Link-Movement-Method

    It just works. Nice to not have to own a bunch of complex code.

提交回复
热议问题