Ionic:IOS 11 中带有 wkwebview 的底部空白区域 [英] Ionic: White space in bottom with wkwebview in IOS 11

查看:73
本文介绍了Ionic:IOS 11 中带有 wkwebview 的底部空白区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 IOS 更新到 11 版本后,我的应用中的 wkwebview 插件 出现问题.

Ionic 命令发布 IOS 11

更新:在我删除 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 >= 110000if (@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

这篇关于Ionic:IOS 11 中带有 wkwebview 的底部空白区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆