I am striving to achieve a similar look as shown in the following images:
https://i.sstatic.net/YFMay.png
However, I am currently at this stage:
https://i.sstatic.net/ZvpBV.png
Please note that the first image showcases a bootstrap form, while the second image displays my design using ionic. Although I prefer not to include bootstrap in my ionic project for various reasons, I aim to get it as close as possible to the desired outcome.
My main query is:
- How can I vertically center the Item name?
[In the second image, I have already attempted using
justify-content-center
andalign-items-center
] - How can I align the text of Item name with Apple (similar to the first image)?
[I tried using
class="ion-float-left"
, however, whether I apply it or not, the item name remains unchanged in the second image. Additionally, when I place the entireion-row
below theion-list
, it does not look visually appealing.]
Below is the code snippet from my ionic file:
product-list.page.html
<ion-header>
<ion-toolbar color="primary" class="ion-text-center">
<ion-title>Stock</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-grid>
<ion-row>
<ion-col size-md="6" offset-md="3">
<ion-card>
<ion-card-header>
<ion-card-title>
</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-row class="background1 justify-content-center align-items-center" style="height: 100%" >
<ion-col>
<ion-text class="ion-float-left" style="font-size: 12px; font-weight: bold; ">Item Name</ion-text>
</ion-col>
<ion-col>
<ion-button (click)=onBackButtonPressed() color="secondary" class="ion-float-right" size="small">
Back
</ion-button>
</ion-col>
</ion-row>
<ion-list *ngIf="currentList">
<ion-item *ngFor="let item of currentList" (click)="setIonList(item)">
{{item}}
</ion-item>
</ion-list>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>