Scroll view problem with ios12, xcode10, cordova and Framework7 v2.3.1 on keyboard closing


I built a cordova app for ios and Android with Framework7 v 2.3.1 and the material design.
It works perfectly, but a few days ago I compiled the cordova app for iOS with xcode 10. On iOS 12 device, if the app is compiled with xcode 10, when I select a input field the keyboard appears and the view scrolls up, but when the keyboard closes, the view doesn’t scroll down, the blank space of the keyboard remains, so it is impossibile for example to go back because the header with the back button is overscrolled. The problem there isn’t if I compile the app with xcode 9.4 and I install it on a device with iOS 12.
I uploaded a screenshot to explain better the problem
Anybody have a solution?

I have figured it out. Include this in your view controller class.
Swift code xcode(10):
if #available(iOS 11.0, *) {
self.webView?.scrollView.contentInsetAdjustmentBehavior = .automatic

Do you use some of cordova-keyboard plugins? I am using cordova plugin keyboard in one of my apps and it works correct in iOS 12 on real device

The problem is with iphone X safearea, it was fixed on other devices but not iphone x. It’s not working in full mode leaving white space on top and bottom. Please advice

With this plugin and setting Keyboard.shrinkView(true) it works fine on iPhone X iOS 12

1 Like

No, I don’t use any cordova-plugin-keyboard. The problems happens on the iOS 12 device on if the app is compiled with Xcode 10. If I use Xcode 9 to compile, the app works perfectly even on iOS 12 device. I used for my test a iPhone 6 with iOS 12.

i update my iPad today to iOS 12
Face the same problem Exactly. that view doesn’t scroll down back when i close keyboard, And i dont think this problem was exist on iOS 11.
Note: I am not using cordova, loading my application on WKWebView.
Using Framework7 3.2.0

‘contentInsetAdjustmentBehavior= automatic’ is ok,but the view’s top become a 20px white bar…how to solve this problem?

i face the same prolem…if you find some way to solve it,please tell me.
email: [email protected]
i also find your question on stackoverflow.

At the moment I haven’t found any solution.
The only way it is to compile the app with Xcode 9, so it works on iOS 11 and also on iOS 12.

The only way to fix is this line of code

if UIDevice().userInterfaceIdiom == .phone {
            switch UIScreen.main.nativeBounds.height {
            case 1136:
                print("iPhone 5 or 5S or 5C")
            case 1334:
                print("iPhone 6/6S/7/8")
            case 1920, 2208:
                print("iPhone 6+/6S+/7+/8+")
            case 2436:
                self.webView?.scrollView.contentInset = UIEdgeInsets(top: 4.0, left: 0.0, bottom: -20.0, right: 0.0);
            case 2688:
                self.webView?.scrollView.contentInset = UIEdgeInsets(top: 4.0, left: 0.0, bottom: -20.0, right: 0.0);
            case 1792:
                self.webView?.scrollView.contentInset = UIEdgeInsets(top: 4.0, left: 0.0, bottom: -20.0, right: 0.0);
if #available(iOS 11.0, *) {
self.webView?.scrollView.contentInsetAdjustmentBehavio "r = .automatic

Set the content inset specific to each device and make the adjustment behavior automatic

1 Like

I installed cordova-plugin-keyboard and inside deviceready function I set Keyboard.automaticScrollToTopOnHiding=true;
I built the app with xcode 10 and now it works on the devices with iOS 12 .

1 Like