<tfoot id='YHMZ4'></tfoot>
<legend id='YHMZ4'><style id='YHMZ4'><dir id='YHMZ4'><q id='YHMZ4'></q></dir></style></legend>

    • <bdo id='YHMZ4'></bdo><ul id='YHMZ4'></ul>
  • <small id='YHMZ4'></small><noframes id='YHMZ4'>

      1. <i id='YHMZ4'><tr id='YHMZ4'><dt id='YHMZ4'><q id='YHMZ4'><span id='YHMZ4'><b id='YHMZ4'><form id='YHMZ4'><ins id='YHMZ4'></ins><ul id='YHMZ4'></ul><sub id='YHMZ4'></sub></form><legend id='YHMZ4'></legend><bdo id='YHMZ4'><pre id='YHMZ4'><center id='YHMZ4'></center></pre></bdo></b><th id='YHMZ4'></th></span></q></dt></tr></i><div id='YHMZ4'><tfoot id='YHMZ4'></tfoot><dl id='YHMZ4'><fieldset id='YHMZ4'></fieldset></dl></div>
      2. 重用的 UIWebView 在 iPhone 上短暂显示之前加载的内容

        时间:2023-10-22

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

                <tbody id='ZhTbD'></tbody>

              <small id='ZhTbD'></small><noframes id='ZhTbD'>

                <bdo id='ZhTbD'></bdo><ul id='ZhTbD'></ul>
                • <i id='ZhTbD'><tr id='ZhTbD'><dt id='ZhTbD'><q id='ZhTbD'><span id='ZhTbD'><b id='ZhTbD'><form id='ZhTbD'><ins id='ZhTbD'></ins><ul id='ZhTbD'></ul><sub id='ZhTbD'></sub></form><legend id='ZhTbD'></legend><bdo id='ZhTbD'><pre id='ZhTbD'><center id='ZhTbD'></center></pre></bdo></b><th id='ZhTbD'></th></span></q></dt></tr></i><div id='ZhTbD'><tfoot id='ZhTbD'></tfoot><dl id='ZhTbD'><fieldset id='ZhTbD'></fieldset></dl></div>
                  本文介绍了重用的 UIWebView 在 iPhone 上短暂显示之前加载的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的一个应用程序中,我重用了一个 webview.每次用户进入某个视图时,使用以下方法将缓存数据重新加载到 webview :-

                  In one of my apps I reuse a webview. Each time the user enters a certain view on reload cached data to the webview using the method :-

                  - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL

                  我等待回调调用

                  - (void) webViewDidFinishLoad:(UIWebView *)webView.

                  与此同时,我隐藏了 webview 并显示了一个正在加载"标签.只有当我收到 webViewDidFinishLoad 时,我才会显示 webview.

                  In the mean time I hide the webview and show a 'loading' label. Only when I receive webViewDidFinishLoad do I show the webview.

                  在我加载的新数据开始之前,我看到之前加载到 webview 的数据有很短的时间.

                  Many times what happens I see the previous data that was loaded to the webview for a brief second before the new data I loaded kicks in.

                  我已经在显示 webview 之前添加了 0.2 秒的延迟,但它没有帮助.

                  I already added a delay of 0.2 seconds before showing the webview but it didn't help.

                  有没有人知道如何解决这个问题,或者可能从 web 视图中清除旧数据而不释放并每次都分配它,而不是通过增加更多时间来解决这个问题?

                  Instead of solving this by adding more time to the delay does anyone know how to solve this issue or maybe clear old data from a webview without release and allocating it every time?

                  推荐答案

                  感谢 malaki1974,就我而言,我没有使用模态视图.当我在 WWDC 2010 上与一位 Apple 工程师坐在一起问他这个问题时,他的回答很简单:不要重复使用 UIWebView,这不是它们的使用方式."从那时起,我确保在分配新的 UIWebView 之前调用这组行

                  Thanks malaki1974, in my case I wasn't using a modal view. When I sat with an Apple engineer on WWDC 2010 and asked him this question his answer was simply: "Don't reuse UIWebViews, that's not how they were ment to be used." Since then I make sure to calls this set of lines before allocating a new UIWebView

                  [self.myWebView removeFromSuperview];
                  self.myWebView.delegate = nil;
                  [self.myWebView stopLoading];
                  [self.myWebView release];
                  

                  这解决了问题.

                  这篇关于重用的 UIWebView 在 iPhone 上短暂显示之前加载的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将 UIWebView 渲染到 ImageContext 下一篇:如何设置我的 Web 视图已加载已登录用户 -iPhone

                  相关文章

                  1. <legend id='anCXN'><style id='anCXN'><dir id='anCXN'><q id='anCXN'></q></dir></style></legend>

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

                    <small id='anCXN'></small><noframes id='anCXN'>

                        <bdo id='anCXN'></bdo><ul id='anCXN'></ul>
                    1. <tfoot id='anCXN'></tfoot>