From 117225f97856118bf6118f323adb678c743c6911 Mon Sep 17 00:00:00 2001 From: Todor Petrov Date: Thu, 25 Oct 2018 17:37:40 +0300 Subject: [PATCH] fix-next: correct raising of layoutChanged event 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 13abd07666..07decab40e 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); }