0

I'm building the app in Ionic 3 and I'm navigating the pages with this.navCtrl.push/pop() functions.

But whenever I push() or pop(), the titles are got overlapped.

attached the screenshot.

enter image description here

Any suggestions?

Thanks

Here is the header code snippets.

<ion-header>

    <ion-navbar [hideBackButton]="true" padding>
        <h6 class="navbar--title">Select acquisitions</h6>
        <ion-buttons end>
            <button (click)="goBack()" class="navbar--back"><i class="icon-chevron-left"></i></button>
        </ion-buttons>
    </ion-navbar>

</ion-header>
Patrick Blind
  • 399
  • 1
  • 4
  • 15

1 Answers1

0

You can fix the overlapping by using NavController Lifecycle events, at least i manage to do it. In your case change the html to:

    <ion-navbar [hideBackButton]="true" padding>
        <h6 class="navbar--title" [hidden]="!showHeader">Select acquisitions</h6>
        <ion-buttons end>
            <button (click)="goBack()" class="navbar--back"><i class="icon-chevron-left"></i></button>
        </ion-buttons>
    </ion-navbar>

Next thing to do is implement inside *.ts file two functions from lifecycle events:

ionWillLeave() {
    this.showHeader = false;
}

ionWillEnter() {
    this.showHeader = true;
}

And ofcourse showHeader value is initially set to false.