【发布时间】:2016-12-22 23:20:32
【问题描述】:
这是我的模态代码:
let modal = Modal.create(DailyReportPage);
this.nav.present(modal);
【问题讨论】:
标签: angular typescript ionic2
这是我的模态代码:
let modal = Modal.create(DailyReportPage);
this.nav.present(modal);
【问题讨论】:
标签: angular typescript ionic2
我应用这种风格:
ion-modal {
.modal-wrapper {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
}
}
【讨论】:
cssClass选项,然后在css中使用class,比如:ion-modal.fullscreen { ... }
你应该关注Modal
模态框是覆盖用户当前页面的内容窗格。通常用于做出选择或编辑项目。
所以如果你想全屏显示。我认为您创建新页面并推送到它
this.nav.push(SamplePage, {item: item});
【讨论】:
nav.push 的行为与全屏模式的预期行为非常相似。很棒的建议。 +1
在你的 scss 文件中应用这个样式
ion-modal {
.modal-wrapper {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
} }
它应该在您的选择器之外。
例如:-
page-mymodal {
//page CSS Codes
}
ion-modal {
.modal-wrapper {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
}
}
【讨论】:
您可以覆盖文件variables.css 中的相关Ionic Sass 变量:
$modal-inset-width: 100%;
$modal-inset-height-large: 100%;
文档(当前版本是 3.9,但我将其与 3.7 一起使用): http://ionicframework.com/docs/theming/overriding-ionic-variables/
【讨论】:
$modal-ios-border-radius: 0;