Skip to content

Commit 963337e

Browse files
authored
refactor: status bar improvements (NativeScript#9154)
1 parent be52cef commit 963337e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/core/ui/page/index.ios.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class UIViewControllerImpl extends UIViewController {
129129
// because changes happen in an interactive transition - IOS will animate between the the states.
130130
// If canceled - viewWillAppear will be called for the current page(which is already loaded) and we need to
131131
// update the action bar explicitly, so that it is not left styles as the previous page.
132-
owner.actionBar.update();
132+
owner.updateWithWillAppear(animated);
133133
}
134134
}
135135

@@ -221,6 +221,7 @@ class UIViewControllerImpl extends UIViewController {
221221
owner.onNavigatingFrom(isBack);
222222
}
223223
}
224+
owner.updateWithWillDisappear(animated);
224225
}
225226

226227
@profile
@@ -368,6 +369,17 @@ export class Page extends PageBase {
368369
this.actionBar.update();
369370
}
370371
}
372+
updateWithWillAppear(animated: boolean) {
373+
// this method is important because it allows plugins to react to modal page close
374+
// for example allowing updating status bar background color
375+
this.actionBar.update();
376+
this.updateStatusBar();
377+
}
378+
379+
updateWithWillDisappear(animated: boolean) {
380+
// this method is important because it allows plugins to react to modal page close
381+
// for example allowing updating status bar background color
382+
}
371383

372384
public updateStatusBar() {
373385
this._updateStatusBarStyle(this.statusBarStyle);

0 commit comments

Comments
 (0)