问题描述
将 IOS 更新到 11 版本后,我的应用程序中的 wkwebview 插件
出现问题.
Ionic 命令发布了 IOS 11
UPDATE:在我删除 cordova-plugin-wkwebview-engine
插件后,空白消失了.但是我的应用中需要这个插件.
关于使用 wkwebview 时的底部空间,这里有一个解决方法:
在cordova-plugin-wkwebview-enginesrciosCDVWKWebViewEngine.m中的99-100行之间添加一些代码,
//重新创建WKWebView,因为我们需要更新配置WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];//添加开始#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000如果(@available(iOS 11.0,*)){[wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];}#万一//添加结尾wkWebView.UIDelegate = self.uiDelegate;self.engineWebView = wkWebView;
以上代码来自cordova-plugin-ionic-webview
After update IOS to 11 version, I have problem with wkwebview plugin
in my app.
Ionic command released IOS 11 checklist but the problem is stay after all steps from checklist.
Ios platform version 4.4.0
Problem on any sim iPnone 5s, 6, 6s...
In screen bottom I have white space. Helps, please.
UPDATE: After i delete cordova-plugin-wkwebview-engine
plugin white space is gone. But I need this plugin in my app.
About the bottom space when using wkwebview, here is a workaround:
Add some code in cordova-plugin-wkwebview-enginesrciosCDVWKWebViewEngine.m between line 99-100,
// re-create WKWebView, since we need to update configuration
WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
//add begin
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
if (@available(iOS 11.0, *)) {
[wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}
#endif
//add end
wkWebView.UIDelegate = self.uiDelegate;
self.engineWebView = wkWebView;
The code above came from cordova-plugin-ionic-webview
这篇关于离子:底部的空白与 IOS 11 中的 wkwebview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!