Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change color of textview hyperlink?

I am using this code for hyperlink:

<TextView      android:layout_width="fill_parent"      android:layout_height="fill_parent"      android:id="@+id/hyperlink"      android:text="@string/hyperlink"     android:autoLink="web"/> 

By default it is showing blue color, but how do I change color of hyperlink in Android?

like image 301
super Avatar asked Jul 20 '11 13:07

super


People also ask

How do I change the hyperlink text color?

To change the color of hyperlink text, click the arrow next to Hyperlink, and then select a color. To change the color of followed hyperlink text, click the arrow next to Followed Hyperlink, and then select a color.

How do I change the color of TextView?

TextView Text Color – To change the color of text in TextView, you can set the color in layout XML file using textColor attribute or change the color dynamically in Kotlin file using setTextColor() method.

How do I make a TextView look like a link?

This is the shortest solution: final CharSequence text = tv. getText(); final SpannableString spannableString = new SpannableString( text ); spannableString. setSpan(new URLSpan(""), 0, spannableString.

What is the color of a link?

1. Hyperlinks. Hyperlinks are blue for two reasons, depending on who you believe. Blue looks like a default choice.


1 Answers

Add android:textColorLink="yourcolorhere" to your TextView

like image 185
iDroid Avatar answered Oct 11 '22 08:10

iDroid