与UIWebView的scalesPageToFit BUT等效的WKWebView设置为FALSE

问题描述 投票:0回答:1

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

启用已在该帖子中得到解答,但我需要知道如何禁用它。

ios objective-c wkwebview
1个回答
0
投票

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

- (void) disableZoom {
    [self.webview.configuration.userContentController removeAllUserScripts];
}
© www.soinside.com 2019 - 2024. All rights reserved.