mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
fix-next: restrict to safe area when transform (#6405)
This commit is contained in:
@ -159,6 +159,7 @@ export class View extends ViewCommon {
|
|||||||
traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout);
|
traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout);
|
||||||
}
|
}
|
||||||
this._cachedFrame = frame;
|
this._cachedFrame = frame;
|
||||||
|
let adjustedFrame = null;
|
||||||
if (this._hasTransfrom) {
|
if (this._hasTransfrom) {
|
||||||
// Always set identity transform before setting frame;
|
// Always set identity transform before setting frame;
|
||||||
const transform = nativeView.transform;
|
const transform = nativeView.transform;
|
||||||
@ -167,11 +168,11 @@ export class View extends ViewCommon {
|
|||||||
nativeView.transform = transform;
|
nativeView.transform = transform;
|
||||||
} else {
|
} else {
|
||||||
nativeView.frame = frame;
|
nativeView.frame = frame;
|
||||||
}
|
// apply safe area insets only if no transform is in place
|
||||||
|
adjustedFrame = this.applySafeAreaInsets(frame);
|
||||||
const adjustedFrame = this.applySafeAreaInsets(frame);
|
if (adjustedFrame) {
|
||||||
if (adjustedFrame) {
|
nativeView.frame = adjustedFrame;
|
||||||
nativeView.frame = adjustedFrame;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const boundsOrigin = nativeView.bounds.origin;
|
const boundsOrigin = nativeView.bounds.origin;
|
||||||
|
Reference in New Issue
Block a user