From 7e891a91f95f5db2617ad22293c284810a471229 Mon Sep 17 00:00:00 2001 From: Martin Yankov Date: Mon, 15 Oct 2018 10:17:56 +0300 Subject: [PATCH] fix-next: restrict to safe area when transform (#6405) --- tns-core-modules/ui/core/view/view.ios.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index 112c7c111..523151c50 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -159,6 +159,7 @@ export class View extends ViewCommon { traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout); } this._cachedFrame = frame; + let adjustedFrame = null; if (this._hasTransfrom) { // Always set identity transform before setting frame; const transform = nativeView.transform; @@ -167,11 +168,11 @@ export class View extends ViewCommon { nativeView.transform = transform; } else { nativeView.frame = frame; - } - - const adjustedFrame = this.applySafeAreaInsets(frame); - if (adjustedFrame) { - nativeView.frame = adjustedFrame; + // apply safe area insets only if no transform is in place + adjustedFrame = this.applySafeAreaInsets(frame); + if (adjustedFrame) { + nativeView.frame = adjustedFrame; + } } const boundsOrigin = nativeView.bounds.origin;