iOS 27.2 Landscape Safe Area Issue in Ionic Cordova App – Missing Left/Right Safe Areas

Hi everyone,

I’m experiencing a strange safe-area issue in my Ionic Angular + Cordova iOS application after testing on iOS 27.2.

I’m hoping someone has encountered something similar or can help me understand whether this is related to Cordova, UIKit, or WebKit.

Environment

  • Ionic Angular
  • Cordova iOS 6.2.0
  • Landscape-only application
  • Testing on physical iOS devices
  • Xcode 27
  • I would prefer not to upgrade Cordova iOS at this point.

The problem

The app works correctly on iOS 27.1, but on iOS 27.2, the landscape safe-area behavior appears to be different.

I’m seeing two main issues:

  1. The black safe-area spaces on the left and right sides are missing.
  2. The status bar area sometimes appears at the top and pushes the app content down. For example, the profile picture in my UI gets shifted downward.

I also tested on an iPhone 15, where the left and right black areas are missing, although the status bar appears normal.

This seems to happen on physical devices. I haven’t been able to reproduce the same behavior in the simulator.

Native debugging results

On the affected physical device, I logged the following:

  • Interface Orientation: Landscape Right
  • Physical Device Orientation: Portrait
  • Native view size: 926 × 428 pt
  • View controller safe-area insets:
    • Left: 0
    • Right: 0
    • Top: 47
    • Bottom: 34
  • Window safe-area insets:
    • Left: 0
    • Right: 0
    • Top: 47
    • Bottom: 34

The WebView initially fills the entire native view.

What I find strange is that, in landscape orientation, I would expect the safe-area insets to be applied to the left and right sides, rather than the top and bottom.

What I’ve tried

  1. Added black native UIView overlays on the left and right sides using the safe-area inset values. However, the horizontal inset values are zero, so this does not solve the issue.

  2. Tried manually applying 80pt left and right margins to the WebView. This gives an expected WebView frame of:

    • X: 80
    • Width: 766
    • Height: 428

    However, the app content still overlaps the intended safe-area region. I’m not sure whether Cordova is resetting the WebView frame or whether the web content is still using the full viewport dimensions.

  3. Added a custom native JavaScript event to report the WebView dimensions to the web application.

  4. Experimented with additionalSafeAreaInsets to compensate for the top and bottom insets, but I haven’t confirmed that this correctly affects the WebView or CSS safe-area values.

Meta viewport configuration

<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

I also have this Cordova preference:

<preference name="StatusBarOverlaysWebView" value="false" />

My questions

  1. Has anyone experienced changes in landscape safe-area behavior on iOS 27.2?
  2. Why would UIKit report top and bottom safe-area insets of 47pt and 34pt when the app is in landscape orientation?
  3. Is there a known issue with Cordova iOS 6.2.0 and the way CDVViewController lays out its WKWebView on newer iOS versions?
  4. Is there a reliable way to force the WebView to respect the correct left and right safe areas in landscape?
  5. Could this be a WebKit viewport issue rather than a native UIKit safe-area issue?

I’m trying to find a reliable fix without upgrading Cordova iOS, if possible.

Any suggestions, insights, or similar experiences would be greatly appreciated.

Thanks!

Great detail! Unfortunately these are Ionic Framework and Capacitor forums so I am not sure how much help you’ll get here for Cordova. You are two major versions behind on Cordova iOS (current is 8.x) so you might want to consider upgrading even though you don’t want to :grinning_face:

You could also consider switching to Capacitor. The Capacitor team and community has done a lot recently to handle safe area properly.

Thanks for the detailed report — your native numbers are the big clue. A top inset of 47pt and a bottom inset of 34pt in landscape are really the portrait insets (the sensor-housing side and the home-indicator side), so UIKit is laying the view out as if the device were still in portrait. That matches your mismatch between interface orientation (Landscape Right) and physical device orientation (Portrait), and it explains why your manual 80pt margins did not help: with viewport-fit=cover the WKWebView fills the whole window, so the page itself has to consume the insets.

A few things worth trying before touching Cordova iOS:

1. In the web layer, read env(safe-area-inset-left) and env(safe-area-inset-right) and apply them as padding on ion-app — Ionic also exposes them as --ion-safe-area-left and --ion-safe-area-right. If WebKit reports the correct left/right values there while UIKit reports 0, the problem is in the native layout, not the web view.

2. On the native side, check that your supported interface orientations really are landscape-only in Xcode, and that nothing reads the safe area before the first rotation completes. CDVViewController only re-lays out the web view on orientation-change notifications, so if iOS 27.2 delivers the first layout while the device orientation is still reported as portrait, the web view keeps the wrong insets until a rotation forces a relayout. Rotating the device once (with orientation lock off) is a quick way to confirm this.

3. For the status bar pushing content down, remember that StatusBarOverlaysWebView=false means the status bar reserves space in the layout, so any change in how iOS 27.2 reports the status bar height will shift your content. Try toggling that setting at runtime after deviceready to see whether the shift goes away — that tells you whether the status bar or the safe area is the culprit.

Since the same build worked on 27.1 and broke on 27.2, this really looks like an iOS regression rather than a Cordova bug, so it is worth reporting to Apple with your repro numbers as well. Hope that helps narrow it down.