Ipad app with two UIWebViews
I have an iPad app with 开发者_如何学Pythontwo UIWebviews, one on top of the other. Is there a way to have all the links that are clicked in one, open in only the other view?
Use this in the delegate for your first UIWebView
:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
[otherWebView loadRequest:request];
return NO;
}
return YES;
}
精彩评论