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

Skip to content

Commit f5cca13

Browse files
tgpetrovMartoYankov
authored andcommitted
fix-next: correct raising of layoutChanged event (NativeScript#6457)
Currently the layoutChanged event can be raised even when there is no change due to safe area calculations.
1 parent 745a79f commit f5cca13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export class View extends ViewCommon {
154154
}
155155

156156
public _setNativeViewFrame(nativeView: UIView, frame: CGRect): void {
157-
if (!CGRectEqualToRect(nativeView.frame, frame)) {
157+
let oldFrame = this._cachedFrame || nativeView.frame;
158+
if (!CGRectEqualToRect(oldFrame, frame)) {
158159
if (traceEnabled()) {
159160
traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), traceCategories.Layout);
160161
}

0 commit comments

Comments
 (0)