mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Merge pull request #1934 from NativeScript/raikov/side-drawer-fix
fixed: some transitions in side drawer are not working
This commit is contained in:
7
application/application.d.ts
vendored
7
application/application.d.ts
vendored
@ -579,4 +579,11 @@ declare module "application" {
|
|||||||
*/
|
*/
|
||||||
removeNotificationObserver(observer: any, notificationName: string): void;
|
removeNotificationObserver(observer: any, notificationName: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* tslint:disable */
|
||||||
|
export interface RootViewControllerImpl {
|
||||||
|
|
||||||
|
contentController: any;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,43 @@ class Responder extends UIResponder {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class RootViewControllerImpl extends UIViewController implements definition.RootViewControllerImpl {
|
||||||
|
private _contentController: UIViewController;
|
||||||
|
|
||||||
|
get contentController(): UIViewController {
|
||||||
|
return this._contentController;
|
||||||
|
}
|
||||||
|
|
||||||
|
set contentController(contentController: UIViewController) {
|
||||||
|
|
||||||
|
if (contentController.parentViewController !== null) {
|
||||||
|
contentController.willMoveToParentViewController(null);
|
||||||
|
contentController.view.removeFromSuperview();
|
||||||
|
contentController.removeFromParentViewController();
|
||||||
|
contentController.didMoveToParentViewController(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._contentController) {
|
||||||
|
this._contentController.willMoveToParentViewController(null);
|
||||||
|
this._contentController.view.removeFromSuperview();
|
||||||
|
this._contentController.removeFromParentViewController();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addChildViewController(contentController);
|
||||||
|
this.view.addSubview(contentController.view);
|
||||||
|
contentController.view.frame = this.view.bounds;
|
||||||
|
contentController.view.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingFlexibleWidth | UIViewAutoresizing.UIViewAutoresizingFlexibleHeight;
|
||||||
|
|
||||||
|
this._contentController = contentController;
|
||||||
|
this._contentController.didMoveToParentViewController(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public viewDidLoad(): void {
|
||||||
|
super.viewDidLoad();
|
||||||
|
this.view.backgroundColor = UIColor.whiteColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Window extends UIWindow {
|
class Window extends UIWindow {
|
||||||
|
|
||||||
private _content;
|
private _content;
|
||||||
@ -144,7 +181,9 @@ class IOSApplication implements definition.iOSApplication {
|
|||||||
this._window.content = rootView;
|
this._window.content = rootView;
|
||||||
|
|
||||||
if (rootView instanceof Frame) {
|
if (rootView instanceof Frame) {
|
||||||
this.rootController = this._window.rootViewController = rootView.ios.controller;
|
let rootController = new RootViewControllerImpl();
|
||||||
|
this.rootController = this._window.rootViewController = rootController;
|
||||||
|
rootController.contentController = rootView.ios.controller;
|
||||||
}
|
}
|
||||||
else if (rootView.ios instanceof UIViewController) {
|
else if (rootView.ios instanceof UIViewController) {
|
||||||
this.rootController = this._window.rootViewController = rootView.ios;
|
this.rootController = this._window.rootViewController = rootView.ios;
|
||||||
|
@ -430,6 +430,7 @@ class UINavigationControllerImpl extends UINavigationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public viewDidLoad(): void {
|
public viewDidLoad(): void {
|
||||||
|
super.viewDidLoad();
|
||||||
let owner = this._owner.get();
|
let owner = this._owner.get();
|
||||||
if (owner) {
|
if (owner) {
|
||||||
owner.onLoaded();
|
owner.onLoaded();
|
||||||
|
Reference in New Issue
Block a user