Need grid to be something like this:
card1 card2
card3 card4
...
And to be dynamic
Here is my try:
component:
export class MenusComponent implements OnInit {
public menus: any;
constructor() {
this.menus = [
{
image: 'https://www.ducksdailyblog.com/wp-content/uploads/2018/12/Wooden-Post-Country-Fences-Direction.jpg',
title: 'Jelovnik'
},
{
image: 'https://www.ducksdailyblog.com/wp-content/uploads/2018/12/Wooden-Post-Country-Fences-Direction.jpg',
title: 'Pica'
},
{
image: 'https://www.ducksdailyblog.com/wp-content/uploads/2018/12/Wooden-Post-Country-Fences-Direction.jpg',
title: 'Dorucak'
}
]
}
Here is my try:
<GridLayout columns="*,*" rows="*">
<ListView class="list-group" [items]="menus">
<ng-template let-menu="item" let-i="index" let-odd="odd" let-even="even">
<StackLayout [col]="even ? 0 : 1">
<Label [text]="menu.title"></Label>
<Image height="108" width="100%" [src]="menu.image"></Image>
</StackLayout>
</ng-template>
</ListView>
I need to be able to add mre things inside list view so I assume there should be anoter grid as well. What is the right way to do this? Cards need to be equal and to take whole screen.