From fe782107090fa4886f9fbfbbda464044bb5dea71 Mon Sep 17 00:00:00 2001 From: Martin Yankov Date: Wed, 15 Aug 2018 11:19:02 +0300 Subject: [PATCH] fix iOS 10 fictional safe area layout --- tns-core-modules/ui/core/view/view.ios.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index 79ef70942..2a92ffd01 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -93,7 +93,9 @@ export class View extends ViewCommon { if (boundsChanged || (this._privateFlags & PFLAG_LAYOUT_REQUIRED) === PFLAG_LAYOUT_REQUIRED) { let position = { left, top, right, bottom }; - if (this.nativeViewProtected) { + if (this.nativeViewProtected && majorVersion > 10) { + // on iOS 11+ it is possible to have a changed layout frame due to safe area insets + // get the frame and adjust the position, so that onLayout works correctly const frame = this.nativeViewProtected.frame; position = this.getPositionFromFrame(frame); }