Mr.Web
Mr.Web

Reputation: 7154

Ionic remove Header logo in sub page

I have this Ionic App with a logo defined in the view-title like this:

<ion-view view-title="<img src='img/main-logo.png'>" ng-controller="ShoesCtrl as shoesItems">
...
</ion-view>

This results in this with a centered logo:

enter image description here

I then have items inside a page that go to a different template which is this:

<ion-view view-title="{{single.name}}">
    <ion-content direction="y" scrollbar-y="false">
        {{single | json}}
    </ion-content>
</ion-view>

When I click an item this opens in the right page but instead of showing the usual "back" button the logo moves to the right, like this:

enter image description here

This happens only in the iOS version. How do I remove the logo in the sub-page only and show a "Back" button.

The index is this:

<ion-nav-bar class="bar-stable">
  <ion-nav-back-button>
  </ion-nav-back-button>
</ion-nav-bar>

Upvotes: 0

Views: 102

Answers (1)

Anuj
Anuj

Reputation: 650

Take a look from https://ionicframework.com/docs/api/directive/ionNavBackButton/

<ion-nav-bar ng-controller="MyCtrl">
  <ion-nav-back-button class="button-clear"
    ng-click="myGoBack()">
    <i class="ion-arrow-left-c"></i> Back
  </ion-nav-back-button>
</ion-nav-bar>
function MyCtrl($scope, $ionicHistory) {
  $scope.myGoBack = function() {
    $ionicHistory.goBack();
  };
}

It will work.

Upvotes: 1

Related Questions