How do you remove links from UIWebView?
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!
I try to disable the user interaction from the x开发者_运维技巧ib file. Didn't help. Can someone help me.
In the <head>
of the html, you can put:
<meta name="format-detection" content="telephone=no">
Safari HTML Reference:
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.
Or to unset this detection from a web view programatically using the dataDetectorTypes mask:
webView.dataDetectorTypes &= ~UIDataDetectorTypePhoneNumber;
Have you tried to change the dataDetectorTypes value ?
You can use this property to specify the types of data (phone numbers, http links, email address, and so on) that should be automatically converted to clickable URLs in the web view. When clicked, the web view opens the application responsible for handling the URL type and passes it the URL.
See more details here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebView/dataDetectorTypes
精彩评论