mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 11:17:04 +08:00
Resovled Issue #421: Modal pages do not render correctly in iOS.
This commit is contained in:
@ -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]);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user