该BOOL
功能不适用于这些 Web 视图。我想知道如何解决它。我可能遗漏了一些小细节。
-(void)viewDidLoad{
UIWebView *webView = [[UIWebView alloc]
initWithFrame:CGRectMake(0, 119,
self.view.bounds.size.width,
self.view.bounds.size.height - 165)];
webView.backgroundColor = [UIColor whiteColor];
webView.userInteractionEnabled = NO;
webView.opaque = NO;
[webView loadHTMLString:self.item.description
baseURL:[NSURL URLWithString:self.item.link]];
[self.view addSubview:webView];
}
-(BOOL) webView:(UIWebView*)inWeb
shouldStartLoadWithRequest:(NSURLRequest*)inRequest
navigationType:(UIWebViewNavigationType)inType{
if (inType == UIWebViewNavigationTypeLinkClicked) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}