开发者

Ipad app with two UIWebViews

开发者 https://www.devze.com 2023-01-07 23:28 出处:网络
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

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消