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

      <tfoot id='fnOPY'></tfoot>

      <legend id='fnOPY'><style id='fnOPY'><dir id='fnOPY'><q id='fnOPY'></q></dir></style></legend>
      • <bdo id='fnOPY'></bdo><ul id='fnOPY'></ul>

      是否可以删除 [“第 1 页,共 20 页"?显示pdf时在UIwebview中查看]?

      Is it possible to remove [quot;Page 1 of 20quot; view] in a UIwebview when displaying pdf?(是否可以删除 [“第 1 页,共 20 页?显示pdf时在UIwebview中查看]?)
    2. <legend id='I6twy'><style id='I6twy'><dir id='I6twy'><q id='I6twy'></q></dir></style></legend>
            <bdo id='I6twy'></bdo><ul id='I6twy'></ul>
              <tbody id='I6twy'></tbody>
          • <tfoot id='I6twy'></tfoot>

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

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

                本文介绍了是否可以删除 [“第 1 页,共 20 页"?显示pdf时在UIwebview中查看]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                经过多次谷歌搜索后,我无法找到解决方案.我有一个带有 PDF 的 UIWebView.

                I can not get to a solution after much googling. I have a UIWebView with a PDF in it.

                我不想要视图:第 1 页,共 20 页" 查看 PDF 文件时左上角的小视图.可以去掉吗?

                I do not want the view: "Page 1 of 20" The small view in the upper left corner when viewing a PDF file. It is possible to remove this?

                推荐答案

                Swift 3 和 WKWebView

                我得到 WKWebView 的所有子视图,然后删除 WKPDFPageNumberIndicator:

                I get all the subviews of the WKWebView and then remove WKPDFPageNumberIndicator:

                func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
                  let webViewSubviews = self.getSubviewsOfView(v: self.webView)
                  for v in webViewSubviews {
                    if v.description.range(of:"WKPDFPageNumberIndicator") != nil {
                      v.isHidden = true // hide page indicator in upper left
                    }
                  }
                }
                
                func getSubviewsOfView(v:UIView) -> [UIView] {
                  var viewArray = [UIView]()
                  for subview in v.subviews {
                    viewArray += getSubviewsOfView(v: subview)
                    viewArray.append(subview)
                  }
                  return viewArray
                }
                

                您可能需要设置 webView.navigationDelegate = self

                更新(未测试)- Swift 4

                保留上面的 getSubviewsOfView 函数并像这样修改 webView 函数:

                Keep the getSubviewsOfView function from above and modify the webView function like this:

                func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
                  let webViewSubviews = self.getSubviewsOfView(v: self.webView)
                  for v in webViewSubviews {
                    if v.isKind(of: UILabel.self) || v.isKind(of: UIImageView.self) || v.isKind(of: UIVisualEffectView.self) {
                      v.isHidden = true
                    }
                  }
                }
                

                这篇关于是否可以删除 [“第 1 页,共 20 页"?显示pdf时在UIwebview中查看]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                iOS UIWebView app opens link in Safari(iOS UIWebView 应用在 Safari 中打开链接)
                Close UIWebView using javascript:window.close();(使用 javascript:window.close() 关闭 UIWebView;)
                NSCachedURLResponse returns object, but UIWebView does not interprets content(NSCachedURLResponse 返回对象,但 UIWebView 不解释内容)
                Trouble hiding iAd banner and displaying UIWebView in its place(无法隐藏 iAd 横幅并在其位置显示 UIWebView)
                Knowing when AJAX has loaded in UIWebView(知道何时在 UIWebView 中加载了 AJAX)
                Load image/logo in existing HTML input field - UIWebView(在现有的 HTML 输入字段中加载图像/徽标 - UIWebView)
              • <i id='7kQcm'><tr id='7kQcm'><dt id='7kQcm'><q id='7kQcm'><span id='7kQcm'><b id='7kQcm'><form id='7kQcm'><ins id='7kQcm'></ins><ul id='7kQcm'></ul><sub id='7kQcm'></sub></form><legend id='7kQcm'></legend><bdo id='7kQcm'><pre id='7kQcm'><center id='7kQcm'></center></pre></bdo></b><th id='7kQcm'></th></span></q></dt></tr></i><div id='7kQcm'><tfoot id='7kQcm'></tfoot><dl id='7kQcm'><fieldset id='7kQcm'></fieldset></dl></div>
                  <tbody id='7kQcm'></tbody>
                <legend id='7kQcm'><style id='7kQcm'><dir id='7kQcm'><q id='7kQcm'></q></dir></style></legend>

                  <small id='7kQcm'></small><noframes id='7kQcm'>

                    <tfoot id='7kQcm'></tfoot>

                      • <bdo id='7kQcm'></bdo><ul id='7kQcm'></ul>