mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Generated platforms declarations for iOS 11
Fixed broken unit-tests ios layout now run only for the innermost viewcontoller ios layout for viewcontrollers now implemented with constraints Added ios11 safeAreas layout support onMeasure back for frame and tab-view so that they won't throw exception if measure is called on them Page parents layout updated after page is layout so that inner layout flags are correct
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
// First reexport so that app module is initialized.
|
||||
export * from "./application-common";
|
||||
|
||||
import { ios as iosView } from "../ui/core/view";
|
||||
import { ios as iosView, ViewBase } from "../ui/core/view";
|
||||
import { Frame, View, NavigationEntry, loadViewFromEntry } from "../ui/frame";
|
||||
import { ios } from "../ui/utils";
|
||||
import * as utils from "../utils/utils";
|
||||
@@ -49,6 +49,7 @@ class IOSApplication implements IOSApplicationDefinition {
|
||||
private _currentOrientation = utils.ios.getter(UIDevice, UIDevice.currentDevice).orientation;
|
||||
private _window: UIWindow;
|
||||
private _observers: Array<NotificationObserver>;
|
||||
private _rootView: ViewBase;
|
||||
|
||||
constructor() {
|
||||
this._observers = new Array<NotificationObserver>();
|
||||
@@ -112,6 +113,7 @@ class IOSApplication implements IOSApplicationDefinition {
|
||||
notify(<LoadAppCSSEventData>{ eventName: "loadAppCss", object: <any>this, cssFile: getCssFileName() });
|
||||
|
||||
const rootView = createRootView(args.root);
|
||||
this._rootView = rootView;
|
||||
const controller = getViewController(rootView);
|
||||
this._window.rootViewController = controller;
|
||||
this._window.makeKeyAndVisible();
|
||||
@@ -238,12 +240,12 @@ export function getNativeApplication(): UIApplication {
|
||||
}
|
||||
|
||||
function getViewController(view: View): UIViewController {
|
||||
let viewController = view.viewController || view.ios;
|
||||
let viewController: UIViewController = view.viewController || view.ios;
|
||||
if (viewController instanceof UIViewController) {
|
||||
return viewController;
|
||||
} else if (view.ios instanceof UIView) {
|
||||
viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(view));
|
||||
viewController.view = view.ios;
|
||||
viewController.view.addSubview(view.ios);
|
||||
return viewController;
|
||||
} else {
|
||||
throw new Error("Root should be either UIViewController or UIView");
|
||||
|
||||
Reference in New Issue
Block a user