open link from UIWebView into Safari (iphone)

后端 未结 1 445
面向向阳花
面向向阳花 2021-01-03 08:14

ok rather than try to explain my problem in text, watch this little video i recorded http://www.youtube.com/watch?v=fwb55jnZI6w

and here is the code for the detail v

1条回答
  •  醉梦人生
    2021-01-03 08:38

    Implement -(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    Then you can do something like this :

    NSURL* url = [request URL];
    if (UIWebViewNavigationTypeLinkClicked == navigationType)
    {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    

    0 讨论(0)
提交回复
热议问题