获取UIWebView上面的按钮点击事件
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
//判断是否是单击
if (navigationType == UIWebViewNavigationTypeLinkClicked)
{
NSURL *url = [request URL];
if([[UIApplication sharedApplication]canOpenURL:url])
{
[[UIApplication sharedApplication]openURL:url];
}
return NO;
}
return YES;
}
网友评论