我正在使用 ion-slide-box
,但问题是,我的 ion-slides
图像大小不同,它动态重复不同大小的图像使用 ng-repeat
<ion-slide ng-repeat="sliderimages in sliderimages">
<img src={{sliderimages.url}} style="width:100%;height:auto;"/>
</ion-slide>
</ion-slide-box>
我使用这个 CSS 来适应所有图像的高度
.slider {
height: 200px;
width:100%;
}
.slider-slide {
color: #000;
background-color: #fff;
height: 100%;
width:100%;
}
但是高度不太合适
我必须添加任意大小的图像,使其适合 Ionic slider 。
最佳答案
max-width: 100vw !important;
max-height: 100vh !important;
这对我有用;-)
关于angularjs - 具有不同图像大小或高度的 ionic slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30772390/