如何从UIWebView删除链接? [英] How do you remove links from UIWebView?

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

问题描述

我正在iPhone应用程序上使用UIWebView.如何删除ios自身放置的链接.例如,我有一些双重价值,而ios则认为这是一个电话号码并突出显示它!

I'm using UIWebView on my iPhone application. How do I remove the links that ios put by it self. For example I have some double value and ios think it's a phone number and highlighting it!

我尝试从xib文件禁用用户交互.没有帮助.有人可以帮我吗?

I try to disable the user interaction from the xib file. Didn't help. Can someone help me.

推荐答案

在html的<head>中,您可以输入:

In the <head> of the html, you can put:

<meta name="format-detection" content="telephone=no">

Safari HTML参考:

默认情况下,iOS上的Safari可检测到任何格式类似于电话的字符串 号码,并使其成为调用该号码的链接.指定 phone = no禁用此功能.

By default, Safari on iOS detects any string formatted like a phone number and makes it a link that calls the number. Specifying telephone=no disables this feature.

或者使用dataDetectorTypes遮罩以编程方式从Web视图中取消此检测:

Or to unset this detection from a web view programatically using the dataDetectorTypes mask:

webView.dataDetectorTypes &= ~UIDataDetectorTypePhoneNumber;

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

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