Issue
I am working in my Ionic 4 App and I have installed the Ionic 4 tab theme and I have made the header common by adding the header code in the app.component.html but the problem is that my is overlapping with the header.
This is my app.component.html:
<ion-header>
<ion-toolbar>
<ion-icon name="more" slot="end"></ion-icon>
</ion-toolbar>
</ion-header>
<ion-app>
<ion-router-outlet></ion-router-outlet>
</ion-app>
This is my tab1.page.html:
<ion-content>
<ion-card class="welcome-card">
<ion-img src="/assets/shapes.svg"></ion-img>
<ion-card-header>
<ion-card-subtitle>Get Started</ion-card-subtitle>
<ion-card-title>Welcome to Ionic</ion-card-title>
</ion-card-header>
<ion-card-content>
<p>Now that your app has been created, you'll want to start building out features and components. Check out some of the resources below for next steps.</p>
</ion-card-content>
</ion-card>
</ion-content>
I have just installed the fresh theme of tabs in Ionic 4 and I have done these changes only.
Any help is much appreciated.
This is my StackBlitz
Solution
To avoid the overlapping of ion-content
you should add a style to the ion-content
<ion-content class="content"></ion-content>
.content{
margin-top: 50px;
}
You can try the above way or else try if this works..
<ion-content padding>
</ion-content>
Add padding to the ion-content
tag
You can check any other solution suits for you here ion-content overlaps with header
Answered By - Sivaramakrishnan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.