mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
fix(application): explicitly pass rootView to initRootView (#10345)
fixes occasional crashes when resuming the app.
This commit is contained in:
@ -364,8 +364,8 @@ export class ApplicationCommon {
|
||||
// rest of implementation is platform specific
|
||||
}
|
||||
|
||||
initRootView() {
|
||||
this.setRootViewCSSClasses(this.getRootView());
|
||||
initRootView(rootView: View) {
|
||||
this.setRootViewCSSClasses(rootView);
|
||||
initAccessibilityCssHelper();
|
||||
initAccessibilityFontScale();
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
|
||||
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
|
||||
}
|
||||
|
||||
this.initRootView();
|
||||
this.initRootView(rootView);
|
||||
this.notifyAppStarted();
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
|
||||
this._window.makeKeyAndVisible();
|
||||
}
|
||||
|
||||
this.initRootView();
|
||||
this.initRootView(rootView);
|
||||
|
||||
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
||||
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;
|
||||
|
@ -1378,7 +1378,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
this._rootView = rootView;
|
||||
|
||||
// sets root classes once rootView is ready...
|
||||
Application.initRootView();
|
||||
Application.initRootView(rootView);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user