您的位置:首页 > 移动开发

uiwebview 禁止数字链接问题(UIDataDetectorTypeNone)

2014-02-19 10:28 537 查看
今天帮助同事解决了一个bug  ,问题是webview  传过来的数字会有链接,后来查询后,

可以用UIDataDetectorTypeNone 来禁止检测 数字链接问题

   m_webView.dataDetectorTypes =
UIDataDetectorTypeNone;

下面是来自网络博客对这个函数的说明


在iOS程序中检测数字和链接[转]

在程序中检测数字和链接

在iPhone 3.0后就支持UIDataDetectorTypes来检测数字和链接。

UIDataDetectorTypePhoneNumber

UIDataDetectorTypeLink

UIDataDetectorTypeNone

UIDataDetectorTypeAll

通过设置dataDetectorTypes属性就可以实现功能

- (void)viewDidLoad {

- self.textView.dataDetectorTypes = UIDataDetectorTypeAll;

- }



同时你也可以通过Interface Builder来设置属性。



参考:
https://developer.apple.com/devcenter/ios/index.action
转自:http://blog.csdn.net/arthurchenjs/article/details/7336280
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios
相关文章推荐