mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #2896 from NativeScript/viewDidLoad-fix
code fixed to work in viewDidLoad
This commit is contained in:
@ -283,9 +283,14 @@ typedExports.start = function (entry?: NavigationEntry) {
|
|||||||
let rootView = createRootView();
|
let rootView = createRootView();
|
||||||
if(rootView) {
|
if(rootView) {
|
||||||
// Attach to the existing iOS app
|
// Attach to the existing iOS app
|
||||||
let rootController = iosApp.nativeApp.keyWindow.rootViewController;
|
var window = iosApp.nativeApp.keyWindow || (iosApp.nativeApp.windows.count > 0 && iosApp.nativeApp.windows[0]);
|
||||||
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null);
|
if(window) {
|
||||||
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
|
var rootController = window.rootViewController;
|
||||||
|
if(rootController) {
|
||||||
|
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null);
|
||||||
|
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user