0
votes

using ionic 3.9.2

Objective:
back button in navbar using ios-arrow-back style and "back" with translate pipe


  1. with setBackButtonText(), manage to set back button text.
    But it's tedious to do it for every page with getting reference of nav bar, set text after view init.
    Any way to set back button text in template in which can set it like {{ 'back' | translate }}

  1. How to use other icon for back button?

first try: ion-nav-back-button, prompt ion-nav-back-button not known

second try:

<ion-buttons start>
  <button ion-button>
    <ion-icon name="ios-arrow-back"></ion-icon>
    <p>back</p>
  </button>
</ion-buttons>

However, it's strange that even with start, the button is on right end.

Playground:
ionic playground

hope to see advice, thanks

1
I hope this will be helpful for you: stackoverflow.com/a/37643450/3786343 - Kamlesh

1 Answers

0
votes

Try this. Works well on android and ios

<ion-buttons left>
    <button ion-button (click)="dismiss()">
      <span ion-text color="primary" showWhen="ios">Back</span>
    </button>
    <button ion-button (click)="dismiss()">
        <ion-icon name="arrow-round-back" showWhen="android,windows"></ion-icon>
      </button>
  </ion-buttons>