开发者

By Clicking an html link i want to open that url in browse?

I am opening an html page开发者_开发知识库 in web view and By Clicking an html link i want to open the given link in to web browser and my application should close.


implement UIWebView's shouldStartLoadWithRequest delegete method and inside it write

-(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request
navigationType:(UIWebViewNavigationType)navigationType {

    if (navigationType == UIWebViewNavigationTypeLinkClicked) {
              [[UIApplication sharedApplication] openURL:[request URL]];
      }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜