【发布时间】:2020-03-12 14:39:08
【问题描述】:
这个answer添加了一个WKUserScript的实例来将scalesPageToFit的值设置为true,但是我需要创建两个方法来启用和禁用scalesPageToFit。
该帖子中已经回答了启用,但我需要知道如何禁用它。
【问题讨论】:
标签: ios objective-c wkwebview
这个answer添加了一个WKUserScript的实例来将scalesPageToFit的值设置为true,但是我需要创建两个方法来启用和禁用scalesPageToFit。
该帖子中已经回答了启用,但我需要知道如何禁用它。
【问题讨论】:
标签: ios objective-c wkwebview
检查框架我设法为WKUserContentController 调用了一个方法来删除所有相关的用户脚本。 WKUserContentController 对象为 JavaScript 提供了一种将消息发布到 Web 视图的方法 (Documentation)
- (void) disableZoom {
[self.webview.configuration.userContentController removeAllUserScripts];
}
【讨论】: