答案 0 :(得分:15)
您也可以将TabsComponent放在页面顶部。 假设您已导入并声明了TabsComponent 您所要做的就是将此属性添加到 app.module.ts
imports: [
IonicModule.forRoot(MyApp,{tabsPlacement: 'bottom'})
],
这实际上只允许您更改标签栏的位置。
答案 1 :(得分:5)
您可以组合标签布局(底部的标签),并在每个页面顶部添加一个工具栏,其中包含以下几个Segment组件:
<ion-header>
<ion-toolbar>
<ion-segment [(ngModel)]="topTab" color="secondary">
<ion-segment-button value="camera">
<ion-icon name="camera"></ion-icon>
</ion-segment-button>
<ion-segment-button value="bookmark">
<ion-icon name="bookmark"></ion-icon>
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</ion-header>
这样,您可以在底部(标签组件)和顶部的标签(带有细分的标题)中添加标签。我不知道这在您的应用环境中是否有意义,但就UI而言,结果与提供的屏幕截图非常相似。
答案 2 :(得分:4)
如果您正在使用Ionic 2或3,那么就是
src\app\app.module.ts
档案tabsPlacement:'bottom'
作为对象值传递给
onicModule.forRoot()
功能。 'top'
代替'bottom'
出现在顶部代码source here。