What is the Android style attribute for the selected link background color?

I have a TextView that I dynamically add using Linkify links (using a special TransformFilter). All of this works great. Now I would like to change the background color of the link when I click it. In CSS, this will be done using the :active pseudo :active .

I would think that I can specify this in styles.xml, but I do not know what the parameter name is.

+4
source share
2 answers

It was just this problem itself, and the solution for me (but I did not use Linkify) was the android:textColorHighlight attribute android:textColorHighlight . I used android:linksClickable="true" instead of Linkify . It probably doesn't make any difference.

+5
source

This may solve your problem .

Basically you should define a ColorStateList (xml to be used as portable). For your TextView

0
source

Source: https://habr.com/ru/post/1340902/


All Articles