1.设置禁止
self.webView.dataDetectorTypes = UIDataDetectorTypeNone;//
2.禁止处理事件发生
UIWebViewNavigationTypeLinkClicked
User tapped a link.(用户利用一个链接。)
UIWebViewNavigationTypeFormSubmitted
User submitted a form.(用户提交表单。)
UIWebViewNavigationTypeBackForward
User tapped the back or forward button.(用户利用后退或前进按钮。)
UIWebViewNavigationTypeReload
User tapped the reload button.(用户利用重载按钮。)
UIWebViewNavigationTypeFormResubmitted
User resubmitted a form.(用户提交表单。)
UIWebViewNavigationTypeOther
Some other action occurred.(其他一些行动发生。)
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
if(navigationType == UIWebViewNavigationTypeLinkClicked){
return NO;
}
return YES;
}