From f5cca13a7caacd29ebf0442f909d7f96dbf6867f Mon Sep 17 00:00:00 2001 From: Todor Petrov Date: Fri, 26 Oct 2018 17:03:23 +0300 Subject: [PATCH] fix-next: correct raising of layoutChanged event (#6457) Currently the layoutChanged event can be raised even when there is no change due to safe area calculations. --- tns-core-modules/ui/core/view/view.ios.ts | 3 ++- 1 file changed, 2 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 0c1a5b15b..80e74267b 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -154,7 +154,8 @@ export class View extends ViewCommon { } public _setNativeViewFrame(nativeView: UIView, frame: CGRect): void { - if (!CGRectEqualToRect(nativeView.frame, frame)) { + let oldFrame = this._cachedFrame || nativeView.frame; + if (!CGRectEqualToRect(oldFrame, frame)) { if (traceEnabled()) { traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout); }