iOS面试
2016-03-08 本文已影响260人
WangDavid
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"11.jpg"]]];
- (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;
}