diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index 80e74267b..327d748ed 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -889,7 +889,15 @@ export namespace ios { // The TabView itself is handled by the OS, so we check the TabView's parent (usually a Page, but can be a Layout). const tabViewItem = owner.parent; const tabView = tabViewItem && tabViewItem.parent; - const parent = tabView && tabView.parent; + let parent = tabView && tabView.parent; + + // Handle Angular scenario where TabView is in a ProxyViewContainer + // Not using instanceof ProxyViewContainer to avoid circular dependency + // TODO: Try moving UILayoutViewController out of view module + if (parent && !parent.nativeViewProtected) { + parent = parent.parent; + } + if (parent) { const parentPageInsetsTop = parent.nativeViewProtected.safeAreaInsets.top; const currentInsetsTop = this.view.safeAreaInsets.top; diff --git a/tns-core-modules/ui/page/page.ios.ts b/tns-core-modules/ui/page/page.ios.ts index 4e737ce36..bf89a2cbc 100644 --- a/tns-core-modules/ui/page/page.ios.ts +++ b/tns-core-modules/ui/page/page.ios.ts @@ -224,7 +224,15 @@ class UIViewControllerImpl extends UIViewController { // If the Page is nested, cross check safe area insets on top and bottom with Frame parent. const frame = owner.parent; // There is a legacy scenario where Page is not in a Frame - the root of a Modal View, so it has no parent. - const frameParent = frame && frame.parent; + let frameParent = frame && frame.parent; + + // Handle Angular scenario where TabView is in a ProxyViewContainer + // Not using instanceof ProxyViewContainer to avoid circular dependency + // TODO: Try moving UIViewControllerImpl out of page module + if (frameParent && !frameParent.nativeViewProtected) { + frameParent = frameParent.parent; + } + if (frameParent) { const parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top; const currentInsetsTop = this.view.safeAreaInsets.top;