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

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

  • <tfoot id='iGBNe'></tfoot>

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

        UIWebView VS WKWebView 加载本地html

        时间:2023-10-22
          <tbody id='11qZI'></tbody>
        <i id='11qZI'><tr id='11qZI'><dt id='11qZI'><q id='11qZI'><span id='11qZI'><b id='11qZI'><form id='11qZI'><ins id='11qZI'></ins><ul id='11qZI'></ul><sub id='11qZI'></sub></form><legend id='11qZI'></legend><bdo id='11qZI'><pre id='11qZI'><center id='11qZI'></center></pre></bdo></b><th id='11qZI'></th></span></q></dt></tr></i><div id='11qZI'><tfoot id='11qZI'></tfoot><dl id='11qZI'><fieldset id='11qZI'></fieldset></dl></div>

      1. <tfoot id='11qZI'></tfoot>

            <small id='11qZI'></small><noframes id='11qZI'>

                <bdo id='11qZI'></bdo><ul id='11qZI'></ul>
                <legend id='11qZI'><style id='11qZI'><dir id='11qZI'><q id='11qZI'></q></dir></style></legend>

                  本文介绍了UIWebView VS WKWebView 加载本地html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我创建了一个带有 500 p 标签的 html 字符串,其中包含时间戳

                  i create a html string with 500 p tag with timestamp in it

                  我使用 UIWebViewWKWebView loadHTMLString:baseURL: 来加载它,而 wkWebView 慢了大约 50% 而不是 UIWebVIew.为什么?

                  i use UIWebView and WKWebView loadHTMLString:baseURL: to load it,and wkWebView is slower about 50% than UIWebVIew. why?

                  UIWebView:0.1681529879570007
                  WKWebView:0.3913570046424866
                  

                  推荐答案

                  对我来说,创建静态变量以避免多次创建 WKWebView 是可行的.Objective-C 示例:

                  For me, creating static variable to avoid creating WKWebView multiple times worked. Objective-C example:

                  - (WKWebView *)webHeaderView
                  {
                      static WKWebView *_webHeaderView = nil;
                      static dispatch_once_t onceToken;
                  
                      dispatch_once(&onceToken, ^{
                          if (!_webHeaderView)
                          {
                              WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
                              _webHeaderView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration];
                          }
                      });
                  
                      return _webHeaderView;
                  }
                  

                  这篇关于UIWebView VS WKWebView 加载本地html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:防止在从磁盘加载的 UIWebView 中缓存 .css 文件 下一篇:如何在 iphone 中使用 UIWebview 使图像地图可点击?

                  相关文章

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

                      <tfoot id='CQtfD'></tfoot>
                      <legend id='CQtfD'><style id='CQtfD'><dir id='CQtfD'><q id='CQtfD'></q></dir></style></legend>
                      • <bdo id='CQtfD'></bdo><ul id='CQtfD'></ul>
                    1. <small id='CQtfD'></small><noframes id='CQtfD'>