Oma*_*hir 9 html css sass ionic-framework ionic3
我正在使用离子模态,我想调整我的模态到全屏,不是所有模态但只有1模态,但无法实现这一点,因为离子本身是使用!important属性设置宽度/高度属性.我试过这样的事情
@media only screen and (orientation: landscape) {
ion-modal {
.modal-wrapper {
position: absolute;
top: 0 !important;
left: 0 !important;
display: block;
width: 100% !important;
height: 100% !important;
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我把它放在页面的范围内时,它没有显示任何效果,但当我把它放在页面的范围之外时,它会改变app中所有模态的宽度/高度.我已经在网上搜索并尝试了很多解决方案,但没有一个有效(或者我可能无法理解它).在这方面的任何帮助将受到高度赞赏.谢谢
Dua*_*nnx 10
首先,为模态添加一个类:
let modal = this.modalCtrl.create("YourModalPage", null, {
cssClass:"my-modal"
})
modal.present();
Run Code Online (Sandbox Code Playgroud)
第二,现在你my-modal上课了.app.scss中的样式:
@media only screen and (orientation: landscape) {
.my-modal {
.modal-wrapper {
position: absolute;
top: 0 !important;
left: 0 !important;
display: block;
width: 100% !important;
height: 100% !important;
}
}
}
Run Code Online (Sandbox Code Playgroud)
请注意:在页面外部添加了模态元素,因此您无法在页面范围内为其设置样式.
| 归档时间: |
|
| 查看次数: |
6295 次 |
| 最近记录: |