- (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;
}
拼接的Html最后加的按钮的方法如下:
NSURL * path = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForRes ource:@"source_page_button" ofType:@"png"]];
[strReturn appendString:[NSString stringWithFormat:@"