删除uiwebview中的超链接 [英] Remove hyperlinks in uiwebview

查看:62
本文介绍了删除uiwebview中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过UIWebview加载html页面.我需要禁用webview中的所有超链接并将其颜色设置为普通文本颜色,即我需要禁用网页检测.

I am trying to load a html page through UIWebview.I need to disable all the hyperlinks in webview and make its color to normal text color i.e i need to disable webpage detection.Is that possible

预先感谢

推荐答案

使用此UIWebView方法

Use this UIWebView method

– stringByEvaluatingJavaScriptFromString:

要使用Javascript.

To use Javascript.

然后使用" document.getElementsByTagName('a')"来获取元素数组并确定是否想要(更改href,更改颜色等)

Then use "document.getElementsByTagName('a')" to get an Array of elements and do want you want (change the href, change the color etc.)

这篇关于删除uiwebview中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆