开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜