Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does UIWebView keep detecting phone numbers?

I have a UIWebView with detect phone numbers unchecked. However, it keeps underlining the numbers in this text:

Version: 2.1 3.19.2009

The text isn't in an anchor or anything. Is there a way to force the UIWebView to not detect phone numbers?

like image 427
4thSpace Avatar asked Apr 20 '09 13:04

4thSpace


2 Answers

Try

webview.dataDetectorTypes = UIDataDetectorTypeNone;
like image 168
Suresh Varma Avatar answered Oct 07 '22 00:10

Suresh Varma


It looks like there is a problem with Interface Builder's UIWebView attributes palette; the "Detects Phone Numbers" checkbox does not seem to have any affect. Examining the UIWebView's detectsPhoneNumbers property at runtime shows that it was not actually modified by IB.

For now, setting the detectsPhoneNumbers property in code to "NO" will work fine. The problem is only with the IB palette.

Unless we're both missing something, this is a bug. I'd suggest filing it at http://bugreport.apple.com/. Additionally, you can post it at http://openradar.appspot.com/ if you'd like to make it visible to other developers.

like image 31
Sean Patrick Murphy Avatar answered Oct 06 '22 23:10

Sean Patrick Murphy