Remove text label from iOS default back button

In order to allow more room for the header bar title, I wanted to remove the ‘Back’ label.

So this Sass addition seemed reasonable:

.bar .button {
    &.back-button {
        .back-text {
            .default-title {
                display: none;
            }
        }
    }
}

However, ideally I would like to just turn this off. That would be more simple, and I wouldn’t have to worry about future changes to the class names or structure breaking that style.

So, does anybody know if there’s a straightforward way to disable that?

If not, I might submit a PR for this, so any tips there would be appreciated also.

1 Like

You can remove the back label in the config function:

app.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
    $ionicConfigProvider.backButton.previousTitleText(false).text('');

    ...
});
6 Likes

OMG That is perfect.

I really thought this might be a “stupid question”, but this kind of detail is important to me.

Thank you so much!

You’re welcome. :smile: It’s in the docs but it’s a little hard to find. I only know this from asking earlier. :stuck_out_tongue: