views:

193

answers:

0

Does anyone know if it's possible to disable the data detectors for phone numbers, email addresses etc in a UIWebView, for specific HTML elements only?

I'd like the detectors to be active for most of the content loaded into the UIWebView, but disable it in certain areas.

If this is possible, I'm assuming it would be achieved by using an HTML attribute in the loaded content (rather than setting some sort of UIWebView property), e.g.

<html>
  <body>
    <h1 datadetectors="off">Header text with number 9123 3456</h1>
    <p>Body text with number 9872 4567</p>
  </body>
</html>

In this example, the number in the <p> would be detected as a phone number due to setting webview.dataDetectorTypes = UIDataDetectorTypeAll, whereas the number in the <h1> would not.