Resovled Issue #421: Modal pages do not render correctly in iOS.

This commit is contained in:
Rossen Hristov
2015-07-14 16:03:09 +03:00
parent feadf177de
commit 2957554ac1
2 changed files with 5 additions and 1 deletions

View File

@ -179,7 +179,7 @@ export class View extends viewCommon.View {
// When in landscape in iOS 7 there is transformation on the first subview of the window so we set frame to its subview.
// in iOS 8 we set frame to subview again otherwise we get clipped.
var nativeView: UIView;
if (!this.parent && this._nativeView.subviews.count > 0) {
if (!this.parent && this._nativeView.subviews.count > 0 && !(<any>this)._isModal) {
trace.write(this + " has no parent. Setting frame to first child instead.", trace.categories.Layout);
nativeView = (<UIView>this._nativeView.subviews[0]);
}

View File

@ -150,6 +150,10 @@ export class Page extends pageCommon.Page {
protected _showNativeModalView(parent: Page, context: any, closeCallback: Function, fullscreen?: boolean) {
(<any>this)._isModal = true;
if (!parent.ios.view.window) {
throw new Error("Parent page is not part of the window hierarchy. Close the current modal page before showing another one!");
}
if (fullscreen) {
this._ios.modalPresentationStyle = UIModalPresentationStyle.UIModalPresentationFullScreen;
utils.ios._layoutRootView(this, UIScreen.mainScreen().bounds);