【发布时间】:2018-02-23 01:47:02
【问题描述】:
app.html
<ion-header>
<ion-navbar>
<ion-title>Blabla</ion-title>
<button ion-button color="primary" (click)="home()">Home</button>
<button ion-button color="primary" (click)="second()">Second</button>
</ion-navbar>
</ion-header>
<ion-content>
</ion-content>
<ion-nav #myNav [root]="rootPage"></ion-nav>
app.component.ts
import { Component, ViewChild } from '@angular/core';
import { Platform, NavController } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';
import { SecondpagePage } from '../pages/secondpage/secondpage';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
@ViewChild('myNav') nav: NavController;
rootPage:any = HomePage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}
home() {
this.nav.setRoot(HomePage);
}
second() {
this.nav.setRoot(SecondpagePage);
}
}
在 HomePage 和 SecondPage 我只放了<ion-content>Test1</ion-content> 和<ion-content>Test2</ion-content>。
现在我遇到了这种情况 - 标题“覆盖”了其余部分。所以我看不到任何文字,因为它在标题下方。我怎样才能改变这种行为?
而且我还想使用一个静态不可移动的标题/导航栏(因为会有动画)。因此,可以更改的内容在该标题/导航栏下。
【问题讨论】:
标签: ionic-framework ionic2 ionic3