I am using InAppSettingsKit for my settings and want to add a company hyperlink in the table view footer. I have successfully add a uiwebview in a section header (which is in the bottom of the table view and appears as the footer). The webview shows the hyperlink but does not respond to touch.
The web view is created in settingsViewController:tableView:viewForHeaderForSection:
UIView *containerView = [[UIView alloc] init];
containerView.backgroundColor = [UIColor clearColor];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(30, 0, self.view.frame.size.width-60, 35)];
webView.delegate = self;
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSYearCalendarUnit fromDate:[NSDate date]];
NSUInteger fontSize = 13;
NSString *link = @"<a href=\"http://www.google.com\">My Hyperlink</a>";
[webView loadHTMLString:[NSString stringWithFormat:@"<html><head></head><body style=\"font-family: sans-serif;font-size:%dpx;\"> <center>Copyright © %d %@</center></body></html>", fontSize, dateComponents.year,link] baseURL:nil];
webView.backgroundColor = [UIColor clearColor];
webView.opaque = NO;
[containerView addSubview:webView];
return containerView;
and the uiwebview delegate method:
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
DDLogVerbose(@"Web view should start load with request %@. InType: %d", inRequest.URL.absoluteString, inType);
if ( inType == UIWebViewNavigationTypeLinkClicked ) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}
Can anyone tell me why the touch does not work?? Btw... webView:shoudStartLoadWithRequest: gets called right away when the table view gets loaded/displayed
Thx!