开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜