• <i id='qE75E'><tr id='qE75E'><dt id='qE75E'><q id='qE75E'><span id='qE75E'><b id='qE75E'><form id='qE75E'><ins id='qE75E'></ins><ul id='qE75E'></ul><sub id='qE75E'></sub></form><legend id='qE75E'></legend><bdo id='qE75E'><pre id='qE75E'><center id='qE75E'></center></pre></bdo></b><th id='qE75E'></th></span></q></dt></tr></i><div id='qE75E'><tfoot id='qE75E'></tfoot><dl id='qE75E'><fieldset id='qE75E'></fieldset></dl></div>
      <bdo id='qE75E'></bdo><ul id='qE75E'></ul>
  • <legend id='qE75E'><style id='qE75E'><dir id='qE75E'><q id='qE75E'></q></dir></style></legend>

      <tfoot id='qE75E'></tfoot>

    1. <small id='qE75E'></small><noframes id='qE75E'>

        获取有关 UIWebView 中的页面更改的通知

        Get notified about a page change in UIWebView(获取有关 UIWebView 中的页面更改的通知)

          • <legend id='39NEs'><style id='39NEs'><dir id='39NEs'><q id='39NEs'></q></dir></style></legend>
            <i id='39NEs'><tr id='39NEs'><dt id='39NEs'><q id='39NEs'><span id='39NEs'><b id='39NEs'><form id='39NEs'><ins id='39NEs'></ins><ul id='39NEs'></ul><sub id='39NEs'></sub></form><legend id='39NEs'></legend><bdo id='39NEs'><pre id='39NEs'><center id='39NEs'></center></pre></bdo></b><th id='39NEs'></th></span></q></dt></tr></i><div id='39NEs'><tfoot id='39NEs'></tfoot><dl id='39NEs'><fieldset id='39NEs'></fieldset></dl></div>

              • <tfoot id='39NEs'></tfoot>
                • <bdo id='39NEs'></bdo><ul id='39NEs'></ul>

                  <small id='39NEs'></small><noframes id='39NEs'>

                    <tbody id='39NEs'></tbody>
                  本文介绍了获取有关 UIWebView 中的页面更改的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我很好奇是否有一种方法可以检测 UIWebView 内显示网站的变化.在我正在开发的应用程序中,我们使用 UIWebView 来呈现部分功能,这些功能基本上是用户需要遵循的几个步骤.但是,在这些步骤结束时,我需要识别一个特定页面,然后应用程序需要显示不同的视图.

                  I'm curious if there's a way to detect a change of the displayed website inside a UIWebView. In an app I'm working on we're using a UIWebView to present a part of the functionality which are basically a few steps the user needs to follow. However, the will be a specific page at the end of these steps that I need to identify and after which the app needs to display a different view.

                  不幸的是,UIWebViewDelegate 似乎没有解决问题.

                  Unfortunately the UIWebViewDelegate doesn't seem to do the trick.

                  推荐答案

                  如果用户步骤在不同的页面上是分开的,而UIWebView需要加载不同的步骤,这确实应该可以委托方法.

                  If the user steps are separated on different pages, and the UIWebView needs to load the different steps, this should indeed be possible with the delegate methods.

                  在这个例子中,我们说用户经历了 3 个步骤,分别命名为 step1.htmstep2.htm,最后是 step3.htm.此代码将检测用户何时到达第三步也是最后一步.

                  In this example, we say that the user goes through 3 steps, named step1.htm, step2.htm and finally step3.htm. This code will detect when the user reaches the third and final step.

                  - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
                      NSString *URLString = [[request URL] absoluteString];
                      if ([URLString isEqualToString:@"http://www.example.com/step3.htm"]) {
                          // The user reached step 3!
                      }
                      return YES;
                  }
                  

                  请注意,使用 absoluteString 方法可能不是找出用户浏览位置的最佳方法.看看querypathparameterString等...

                  Note that using the absoluteString method might not be the best way to find out where the user is browsing. Take a look at query, path, parameterString, etc...

                  这篇关于获取有关 UIWebView 中的页面更改的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                  Mobile Device Management with iPhone(使用 iPhone 进行移动设备管理)
                  iPhone: How to allow multiple selection in tabelview for a custom cell?(iPhone:如何允许在自定义单元格的表格视图中进行多项选择?)
                  <i id='iiso8'><tr id='iiso8'><dt id='iiso8'><q id='iiso8'><span id='iiso8'><b id='iiso8'><form id='iiso8'><ins id='iiso8'></ins><ul id='iiso8'></ul><sub id='iiso8'></sub></form><legend id='iiso8'></legend><bdo id='iiso8'><pre id='iiso8'><center id='iiso8'></center></pre></bdo></b><th id='iiso8'></th></span></q></dt></tr></i><div id='iiso8'><tfoot id='iiso8'></tfoot><dl id='iiso8'><fieldset id='iiso8'></fieldset></dl></div>

                  • <small id='iiso8'></small><noframes id='iiso8'>

                      <legend id='iiso8'><style id='iiso8'><dir id='iiso8'><q id='iiso8'></q></dir></style></legend>
                        <tfoot id='iiso8'></tfoot>
                          <tbody id='iiso8'></tbody>
                          • <bdo id='iiso8'></bdo><ul id='iiso8'></ul>