【问题标题】:Equivalent WKWebView for UIWebView's scalesPageToFit BUT set to FALSEUIWebView 的 scalesPageToFit 但设置为 FALSE 的等效 WKWebView
【发布时间】:2020-03-12 14:39:08
【问题描述】:

这个answer添加了一个WKUserScript的实例来将scalesPageToFit的值设置为true,但是我需要创建两个方法来启用和禁用scalesPageToFit。

该帖子中已经回答了启用,但我需要知道如何禁用它。

【问题讨论】:

    标签: ios objective-c wkwebview


    【解决方案1】:

    检查框架我设法为WKUserContentController 调用了一个方法来删除所有相关的用户脚本。 WKUserContentController 对象为 JavaScript 提供了一种将消息发布到 Web 视图的方法 (Documentation)

    - (void) disableZoom {
        [self.webview.configuration.userContentController removeAllUserScripts];
    }
    

    【讨论】:

      猜你喜欢
      • 2014-12-05
      • 1970-01-01
      • 1970-01-01
      • 2011-01-21
      • 1970-01-01
      • 2015-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多