我希望我的警报中有很多功能,所以我在一个模态中实现了所有的东西......现在我想将此模态切割为一个警报,例如不占用屏幕上的整个空间并在左侧的空间上显示 bg我们的模态.如下图所示
I wanted many functionalities in my alert so i implemented all the things in a modal...now i want to cutomize this modal as an alert like not taking the whole space on the screen and showing the bg on the space left outsude our modal. as shown in the image below
例如:你能告诉我如何在模态框之外实现,使它看起来像一个警报..在离子 2
eg: can you tell me ow to implement outside the modal so that it looks like an alert.. in ionic 2
请帮忙,谢谢
可以借助 scss 进行调整
You can adjust this with the help of scss
.modal-wrapper {
position: absolute;
width: 90%;
height: 65%;
top: 20%;
left: 5%;
}
您可以根据需要更改内容的宽度、高度、顶部和左侧.请注意,修改此值将使您的应用程序中的所有模态都使用此配置而不是默认模态.
You can alter the content width, height, top and left as per your need. Kindly note that modifying this value will make all the modal in your application to use this configuration rather than the default modal.
要以灰色显示背景,请使用以下代码
To show the backdrop in grey color, use the below code
@media not all and (min-height: 600px) and (min-width: 768px) {
ion-modal ion-backdrop {
visibility: visible;
}
}
这篇关于像 Ionic 2 中的模态一样警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
ionic - 如何在 ion-header 中对长字符串进行自动换行ionic - How to wordwrap a long string in ion-header(ionic - 如何在 ion-header 中对长字符串进行自动换行)
如何在角度2中动态更改css类名How to change the css class name dynamically in angular 2(如何在角度2中动态更改css类名)
使用模态和样式的 Ionic 2 登录弹出窗口Ionic 2 login popup using Modal and styling(使用模态和样式的 Ionic 2 登录弹出窗口)
将 gregorian 日期转换为 angular 2 和 Ionic 2 中的波斯Convert gregorian date to persian(jalali) date in angular 2 and Ionic 2(将 gregorian 日期转换为 angular 2 和 Ionic 2 中的波斯(jalali)日期)
如何在ionic 3中进行水平滚动how to do horizontal scroll in ionic 3(如何在ionic 3中进行水平滚动)
与另一个离子卡重叠的虚拟滚动 ion-img 标签Virtual scroll ion-img tag overlapping to another ion card(与另一个离子卡重叠的虚拟滚动 ion-img 标签)