2016-12-27 38 views

回答

2

enter image description here

我們可以用模態而不是使用警報給予填充到模態..加入莫代爾&寫這樣的代碼在App.scss :)

ion-modal { 
    background-color: rgba(0, 0, 0, 0.5); 
    ion-content.content{ 
     top: 20%; 
     left: 10%; 

     width: 80%; 
     height: 50%; 
     border-radius: 10px; 
     .scroll-content { 
      border-radius: 20px; 
     } 
    } 
} 
+0

有沒有有它適合內容大小的方法嗎?所以它不會與屏幕拉伸? –

+1

@TadijaBagarić你可以給背景色透明,這樣白色背景不會見過那麼你的內容是適合現在:) –

1

我使用以下,以獲得所需峯尺寸。

.always-modal .modal-wrapper{ 
    background: rgba(0, 0, 0, 0.7); 
    width: 100%; 
    height: 100%; 
    left: unset !important; 
    top: unset !important; 
    .ion-page{ 
     margin:0 auto; 
     position: relative; 
     top:10%; 
     width: 75%; 
     height: 80%; 
    } 
} 

現在,無論何時我需要具有這些屬性的模態,我都會在模態選項中傳遞以下內容。

{ cssClass: "always-modal" } 

我不能弄清楚當用戶點擊背景區域時如何解除這種模式。

+0

有沒有有它適合內容大小的方法嗎?所以它不會與屏幕拉伸? –