Ionic: White space in bottom with wkwebview in IOS 11

后端 未结 4 1062
走了就别回头了
走了就别回头了 2021-01-12 12:10

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 a

相关标签:
4条回答
  • 2021-01-12 12:14

    Add viewport-fit=cover to solve this problem.

    <meta name="viewport" content="viewport-fit=cover, initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    
    0 讨论(0)
  • 2021-01-12 12:32

    None of the provided solutions worked for me. For iOS 11+ try the below, solved my problem.

    Add the below line to your config.xml

    <plugin name="cordova-plugin-disable-ios11-statusbar" source="npm" spec="*"/>

    Goodluck!

    0 讨论(0)
  • 2021-01-12 12:39

    I uninstallied plugin cordova-plugin-wkwebview-engine and install cordova-plugin-ionic-webview and it`s work perfectly.

    0 讨论(0)
  • 2021-01-12 12:40

    About the bottom space when using wkwebview, here is a workaround:

    Add some code in cordova-plugin-wkwebview-engine\src\ios\CDVWKWebViewEngine.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

    0 讨论(0)
提交回复
热议问题