Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TextView link without underline?

Tags:

android

I use a TextView with links by this:

TextView tv ... 
tv.setText( Html.fromHtml(somehtml)) 

It is ok to control the link color by setting attribute android:textColorLink, but can I remove the underline of it?

like image 650
Jammy Lee Avatar asked Jun 25 '10 06:06

Jammy Lee


People also ask

How to Remove underline from TextView in Android?

There is a really practical and easy way to remove underline for a text. And that is: textview. setPaintFlags(View. INVISIBLE);

How do I get rid of underline in Spannable Android?

@Override public void updateDrawState(@NonNull TextPaint ds) { // super. updateDrawState(ds); } },0, spannableString. length(), SPAN_EXCLUSIVE_EXCLUSIVE); The updateDrawState overrides the updateDrawState in the ClickableSpan class in Android, and by not calling super.

How do I get rid of the line on my keyboard?

On your keyboard, press and hold the left or right Shift key and then press the End key to highlight the entire line. Press the Delete key to delete the line of text.


1 Answers

OK now with html anchor tag, to avoid the underline now use the property STYLE="text-decoration:none"

< a STYLE="text-decoration:none" HREF=\"link.html\">it has no underline < /a >

this must work with a WebView but in a TextView I was using Android 1.5, 1.6 and thats not possible. =(

like image 172
Jorgesys Avatar answered Sep 28 '22 10:09

Jorgesys