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;
}
答案 0 :(得分:1)
您尚未在webView上设置委托。