問題描述
我希望我的警報中有很多功能,所以我在一個模態(tài)中實(shí)現(xiàn)了所有的東西......現(xiàn)在我想將此模態(tài)切割為一個警報,例如不占用屏幕上的整個空間并在左側(cè)的空間上顯示 bg我們的模態(tài).如下圖所示
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
例如:你能告訴我如何在模態(tài)框之外實(shí)現(xiàn),使它看起來像一個警報..在離子 2
eg: can you tell me ow to implement outside the modal so that it looks like an alert.. in ionic 2
請幫忙,謝謝
推薦答案
可以借助 scss 進(jìn)行調(diào)整
You can adjust this with the help of scss
.modal-wrapper {
position: absolute;
width: 90%;
height: 65%;
top: 20%;
left: 5%;
}
您可以根據(jù)需要更改內(nèi)容的寬度、高度、頂部和左側(cè).請注意,修改此值將使您的應(yīng)用程序中的所有模態(tài)都使用此配置而不是默認(rèn)模態(tài).
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;
}
}
這篇關(guān)于像 Ionic 2 中的模態(tài)一樣警報的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!