How do I stop the navbar from disappearing when I click the back button on iOS using Ionic 2?


#1

Can you help me with this error?


#2

Could you please share some of your code over here? Little bit hard to tell based on that vid only.


#3

It’s a pretty standard list with a link to a specific item. I haven’t implemented much custom code except for the background image in the top part of the item.

<ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
    <ion-avatar item-left>
      <img src="{{ item.imgpath }}">
    </ion-avatar>
    <h2>{{ item.title }}</h2>
    <p>{{ item.category }}</p>
</ion-item>

Here is the single-item file:

logo
<!-- Header content with background -->
<div class="header text-center">

  <br>

  <!-- Item title -->
  <h3 class="headline">
    {{ item.title }}
  </h3>
  <!-- End of Item title -->

  <br>

  <!-- Item Category -->
  <a class="btn__line__square__white">
    {{ item.category }}
  </a>
  <!-- End of Item Category -->

  <br>
  <br>
  <br>

</div>
<!-- End of Header Content -->

<!-- Content Description -->
<div class="item__content">
  <p padding>
    {{ item.description }}
  </p>
</div>
<!-- End of Content Description -->

#4

The background-image could be the culprit though. Since it seems you’re pushing it underneath the navbar. What happens if you don’t pull that background-image up or if you don’t add it all?


#5

Thanks for your input. You are right about the background image. I applied it to a class I named header, which also existed in the navbar on iOS. Once I renamed the class the problem disappeared. Apparently that class was just visible during the animation.