Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Why WKWebView has 20pt offset? #81

Closed
3 tasks done
zhuzhengjing opened this issue Mar 6, 2019 · 1 comment
Closed
3 tasks done

Why WKWebView has 20pt offset? #81

zhuzhengjing opened this issue Mar 6, 2019 · 1 comment

Comments

@zhuzhengjing
Copy link

Bug Report

Problem

What is expected to happen?

Hi, I am using cordova for my iOS app. Why WKWebView has 20pt offset?

What does actually happen?

wkwebview-20px

Information

WKWebView: 0x10a043a00; frame = (0 0; 375 667)
WKContentView: 0x10a044000; frame = (0 0; 375 647)
667 - 647 = 20

Command or Code

Environment, Platform, Device

iPhone 6 Plus iOS 12.1

Version information

{
"dependencies": {
        "code-push": "^2.0.6",
        "cordova-android": "^7.1.4",
        "cordova-ios": "^4.5.5",
        "cordova-plugin-add-swift-support": "^1.7.2",
        "cordova-plugin-camera": "^4.0.3",
        "cordova-plugin-code-push": "^1.11.17",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-device": "^2.0.2",
        "cordova-plugin-dialogs": "^2.0.1",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-file-transfer": "^1.6.3",
        "cordova-plugin-jcore": "^1.2.7",
        "cordova-plugin-qrscanner": "^2.6.0",
        "cordova-plugin-splashscreen": "^5.0.2",
        "cordova-plugin-whitelist": "^1.3.3",
        "cordova-plugin-wkwebview-engine": "^1.1.4",
        "cordova-plugin-zip": "^3.1.0",
        "cordova-sms-plugin": "^0.1.13",
        "jpush-phonegap-plugin": "^3.6.3"
    },
    "cordova": {
        "plugins": {
            "cordova-plugin-camera": {},
            "cordova-plugin-whitelist": {},
            "cordova-plugin-qrscanner": {},
            "cordova-sms-plugin": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-wkwebview-engine": {},
            "cordova-plugin-code-push": {},
            "cordova-plugin-file": {},
            "cordova-plugin-file-transfer": {},
            "cordova-plugin-zip": {},
            "jpush-phonegap-plugin": {
                "APP_KEY": "516c01129ec34e64ec5e462d",
                "CHANNEL": "developer-default"
            }
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@zhuzhengjing
Copy link
Author

zhuzhengjing commented Mar 7, 2019

Update:
Edit engineWebView in CDVWKWebViewEngine.m, add this

wkwebview.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant