問題描述
我希望我的警報中有很多功能,所以我在一個模態中實現了所有的東西......現在我想將此模態切割為一個警報,例如不占用屏幕上的整個空間并在左側的空間上顯示 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模板網!