【发布时间】:2019-02-27 09:27:29
【问题描述】:
我正在使用 Ionic 4 应用程序并安装了 Ionic 4 选项卡主题,并通过在 app.component.html 中添加标题代码使标题通用,但问题是我的与标题重叠。
这是我的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>
这是我的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>
我刚刚在 Ionic 4 中安装了全新的标签主题,我只做了这些更改。
非常感谢任何帮助。
这是我的StackBlitz
【问题讨论】:
-
设置一个通用的标题是 ionic 团队不希望你做的,一个标题应该在每个页面上。你可以让你的生活更轻松一些,并制作一个自定义标题组件,然后将其添加到页面顶部,例如:
<my-custom-header></my-custom-header> -
@AJT_82。我已经添加了我的 stackblitz。你能把组件添加到这个吗?
标签: angular ionic-framework ionic4