【发布时间】:2019-02-25 02:41:33
【问题描述】:
我正在尝试制作像图像中的那样水平滚动的卡片。 有谁知道如何做到这一点?无论图像本身的大小如何,我都需要卡片具有相同的高度。
非常感谢。你可以试试我的意思是这里的卡片: https://www.appimin.com/
编辑:这是我尝试过的
slider.html
<ion-scroll scrollX="true" direction="x">
<ion-card *ngFor="let dat of data">
<img [src]="dat.attachments[0]" style="object-fit: cover;"/>
<ion-card-content>
<p>
{{ dat.title }}
</p>
</ion-card-content>
</ion-card>
</ion-scroll>
slider.ts
.scroll-zoom-wrapper {
white-space: nowrap;
}
ion-card {
width: 220px !important;
display: inline-block;
max-height: 100% !important;
}
ion-scroll {
min-height: 200px;
height: auto;
.scroll-content {
padding: 0px !important;
}
}
This is what I got. It scrolls fine, but all of them are different heights.
【问题讨论】:
-
你应该继续发布你已经尝试过的代码,不要害羞:)
标签: angular typescript sass ionic3