<tfoot id='h43oC'></tfoot>

      <bdo id='h43oC'></bdo><ul id='h43oC'></ul>

    1. <i id='h43oC'><tr id='h43oC'><dt id='h43oC'><q id='h43oC'><span id='h43oC'><b id='h43oC'><form id='h43oC'><ins id='h43oC'></ins><ul id='h43oC'></ul><sub id='h43oC'></sub></form><legend id='h43oC'></legend><bdo id='h43oC'><pre id='h43oC'><center id='h43oC'></center></pre></bdo></b><th id='h43oC'></th></span></q></dt></tr></i><div id='h43oC'><tfoot id='h43oC'></tfoot><dl id='h43oC'><fieldset id='h43oC'></fieldset></dl></div>

    2. <small id='h43oC'></small><noframes id='h43oC'>

    3. <legend id='h43oC'><style id='h43oC'><dir id='h43oC'><q id='h43oC'></q></dir></style></legend>

        iphone上的UIWebView电话链接检测

        时间:2023-11-09
        <tfoot id='79maK'></tfoot>

          <legend id='79maK'><style id='79maK'><dir id='79maK'><q id='79maK'></q></dir></style></legend>

            <bdo id='79maK'></bdo><ul id='79maK'></ul>
              <tbody id='79maK'></tbody>

            <small id='79maK'></small><noframes id='79maK'>

              <i id='79maK'><tr id='79maK'><dt id='79maK'><q id='79maK'><span id='79maK'><b id='79maK'><form id='79maK'><ins id='79maK'></ins><ul id='79maK'></ul><sub id='79maK'></sub></form><legend id='79maK'></legend><bdo id='79maK'><pre id='79maK'><center id='79maK'></center></pre></bdo></b><th id='79maK'></th></span></q></dt></tr></i><div id='79maK'><tfoot id='79maK'></tfoot><dl id='79maK'><fieldset id='79maK'></fieldset></dl></div>
                1. 本文介绍了iphone上的UIWebView电话链接检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的代码有些奇怪.我肯定会忘记一些东西,但我不知道是什么.我尝试在 UIWebView 中处理电话、短信、mailto 和 http 链接.

                  there is something strange in my code. I'm sure to forget something but i don't know what. I try to handle phone, sms mailto and http links in an UIWebView.

                  这就是我尝试的方式:

                  1/实例化 UIWebView :

                  1/ instantiate the UIWebView :

                  webview = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,460)]; 
                  webview.opaque = NO;
                  webview.backgroundColor = [UIColor clearColor];
                  webview.userInteractionEnabled = YES;
                  webview.dataDetectorTypes = UIDataDetectorTypeAll;
                  

                  2/设置适当的委托:

                  [webview setDelegate: self];
                  

                  3/实现委托方法(这里是简化版):

                  3/ implement the delegate method (simplified version here) :

                  - (BOOL)webView:(UIWebView *)webView
                   shouldStartLoadWithRequest:(NSURLRequest *)request
                    navigationType:(UIWebViewNavigationType)navigationType; {
                  
                    NSURL *requestURL = [[ request URL] retain];
                    NSLog(@">>> %@", [requestURL scheme]);
                    [requestURL release];
                    return YES;
                  }
                  

                  当我触摸一个 http 链接时,我的调试设备会打印 NSLog.当我触摸电话链接时,我会收到这种确认消息:

                  With my debug device when i touch an http link, the NSLog is printed. When i touch a tel link i have this kind of confirmation message :


                  (来源:cahripub.com)

                  使用 iPhone 模拟器,NSLog 可以正确打印 tel 和 http 链接.

                  With the iPhone Simulator, tel and http links are correctly printed by NSLog.

                  很奇怪,不是吗?

                  推荐答案

                  对于现在正在看这个的任何人,都可以这样做:

                  For anyone looking at this now, this will do it:

                  self.webView.dataDetectorTypes = UIDataDetectorTypeNone;
                  

                  这篇关于iphone上的UIWebView电话链接检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iPhone UIWebView - 你如何设置缩放级别和位置? 下一篇:UIWebView 加载本地内容的延迟

                  相关文章

                  1. <i id='8a1Zz'><tr id='8a1Zz'><dt id='8a1Zz'><q id='8a1Zz'><span id='8a1Zz'><b id='8a1Zz'><form id='8a1Zz'><ins id='8a1Zz'></ins><ul id='8a1Zz'></ul><sub id='8a1Zz'></sub></form><legend id='8a1Zz'></legend><bdo id='8a1Zz'><pre id='8a1Zz'><center id='8a1Zz'></center></pre></bdo></b><th id='8a1Zz'></th></span></q></dt></tr></i><div id='8a1Zz'><tfoot id='8a1Zz'></tfoot><dl id='8a1Zz'><fieldset id='8a1Zz'></fieldset></dl></div>

                    <small id='8a1Zz'></small><noframes id='8a1Zz'>

                      <bdo id='8a1Zz'></bdo><ul id='8a1Zz'></ul>
                  2. <legend id='8a1Zz'><style id='8a1Zz'><dir id='8a1Zz'><q id='8a1Zz'></q></dir></style></legend>

                  3. <tfoot id='8a1Zz'></tfoot>