Chatar Veer Suthar
Chatar Veer Suthar

Reputation: 15639

How to remove <a href> </a> color of link?

I am getting NSString as

 <a href="http://www.googel.com.com/index.php?route=common/search" target="_blank">click here</a>

In UIWebView, it looks like blue color.

I either want to remove blue color or simply remove this TAG.

I removed link check from XIB Attribute Inspector, but it only detects as

www.google.com

How can I do it.

Thanks

Upvotes: 1

Views: 775

Answers (3)

Vishal Kardode
Vishal Kardode

Reputation: 971

solution 1: Remove anchor text color

Append following to the string received

a:link, a:hover, a:active { color: black; }

Solution 2: remove Anchor tag

for this you can write (or can search on google) Regex for removeing anchor tag

Upvotes: 0

Nikos M.
Nikos M.

Reputation: 13783

On iOS 7 you can set the tintColor of UIWebView. It affects the datadetector link color:

[yourWebView setTintColor:[UIColor blackColor]];

So you can make it the same color as your text.

Upvotes: 1

Peter Segerblom
Peter Segerblom

Reputation: 2813

If you get a NSString with html content you can always append a html script tag to the original html and use css to style your content any way you like.

Upvotes: 0

Related Questions