开发者

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

开发者 https://www.devze.com 2022-12-26 18:02 出处:网络
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 shouldStartL

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

精彩评论

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