2016-12-27 39 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

有没有有它适合内容大小的方法吗?所以它不会与屏幕拉伸? –