Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e891a9

Browse files
authored
fix-next: restrict to safe area when transform (NativeScript#6405)
1 parent 829d18b commit 7e891a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tns-core-modules/ui/core/view/view.ios.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class View extends ViewCommon {
159159
traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout);
160160
}
161161
this._cachedFrame = frame;
162+
let adjustedFrame = null;
162163
if (this._hasTransfrom) {
163164
// Always set identity transform before setting frame;
164165
const transform = nativeView.transform;
@@ -167,11 +168,11 @@ export class View extends ViewCommon {
167168
nativeView.transform = transform;
168169
} else {
169170
nativeView.frame = frame;
170-
}
171-
172-
const adjustedFrame = this.applySafeAreaInsets(frame);
173-
if (adjustedFrame) {
174-
nativeView.frame = adjustedFrame;
171+
// apply safe area insets only if no transform is in place
172+
adjustedFrame = this.applySafeAreaInsets(frame);
173+
if (adjustedFrame) {
174+
nativeView.frame = adjustedFrame;
175+
}
175176
}
176177

177178
const boundsOrigin = nativeView.bounds.origin;

0 commit comments

Comments
 (0)