How to change hyperlink color in xml layout
In my project I am not able to change the color of the hyperlink text. Basically this text is shown in TextView and for it I have used xml layout such as android:autoLink="all"
Now the problem is that I want to change the col开发者_StackOverflow中文版or of this hyperlink text to white
Thanks all in advance.
use this property android:textColorLink="@android:color/white"
for that textView
Don't know if you still need to know this, put it here in case other people want to know. If you want to change the link text color when it is clicked, just try this:
1 create res/color folder, create linkcolor.xml in this folder
2 put these code in linkcolor.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:color="#FFFF0000"/>
<item android:state_focused="true" android:color="#FFFF0000"/>
<item android:color="#FF00FF00"/>
</selector>
3 for your TextView, just add:
android:textColorLink="@color/linkcolor"
精彩评论