我正在尝试使用 ionic2 在每行中放置两个项目(两列),但它不起作用。
<ion-grid>
<ion-row wrap>
<ion-col width-50 *ngFor="let item of items">
<div class="myCell">
<div class="card">
<div class="item item-body">
<img class="full-image" src="...">
<div class="item item-avatar">
<img src="...">
</div>
<div style="font-size:3vw;margin:2vw"> {{item.name}}</div>
</div>
</div>
</div>
</ion-col>
</ion-row>
I use this code but it still not working, someone knows something about this difficult topic?
谢谢
Ionic 使用类似于 bootstrap 的网格系统,它有 12 列。因此,如果您希望您的列占据 50% 的宽度,则它们必须每列占据 6 列的空间(因为 100% 是 12 列)。
只需将 width-50 更改为 col-6。
<ion-col col-6 *ngFor="let item of items">
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句