Whats the Android Style attribute for selected link background color?
I have a TextView which I dynamically add clickable links via Linkify (with a custom TransformFilter). This all works great. What I would like to do now is change the b开发者_Python百科ackground color of the link when its clicked. In CSS it would be done via the :active
pseudo-selector.
I would think I can specify this in styles.xml but I dont know what the parameter name is.
Just had this problem myself and the solution for me (but I didn't use Linkify) was the android:textColorHighlight
attribute. I used android:linksClickable="true"
instead of Linkify
though. That won't probably make any difference.
This might solve your problem .
Basically you have to define a ColorStateList
(a xml to be used as a drawable). For your TextView
精彩评论