Remove hyperlinks in uiwebview

ⅰ亾dé卋堺 提交于 2019-12-08 10:05:02

问题


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

Thanks in advance


回答1:


Use this UIWebView method

– stringByEvaluatingJavaScriptFromString:

To use Javascript.

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



来源:https://stackoverflow.com/questions/3880250/remove-hyperlinks-in-uiwebview

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!