peter.o
peter.o

Reputation: 3530

Sencha touch - change back button text for image in NavigationBar

I'm usign Sencha Touch 2.1 so this code should work (link I used for inspiration):

defaultBackButtonText: null,
        useTitleForBackButtonText: false,
        backButton: {
            // ui: 'toolbar-back',
            // align : 'left',
            iconCls: 'back',
            iconMask: true
        },

But I can still see icon and text as well.

Thanks a lot.

Upvotes: 0

Views: 2758

Answers (2)

bjudson
bjudson

Reputation: 4083

I use an empty string instead of null for defaultBackButtonText, and it removes the text (also using ST 2.1):

defaultBackButtonText: '',

EDIT: To clarify, this is an example of the full config for a nav view with a back button using an icon with no text:

Ext.define('MyApp.view.GroupNavView', {
    extend: 'Ext.navigation.View',
    xtype: 'groupnavview',

    config: {
        defaultBackButtonText: '',

        navigationBar: {
            backButton: { 
                iconCls:'arrow_left', 
                iconMask: true,
                ui: 'dark',
                cls: 'backButton'
            }
        },

        items: [
            {
                xtype: 'mylist'
            }
        ]
    }
});

Upvotes: 3

Swar
Swar

Reputation: 5503

I think there is no "back" iconCls available in the default theme. Try using some other icon like "home". Also, you missed the navigationBar config. It should be like this:

defaultBackButtonText : null,
navigationBar: {
  backButton : {
    align : 'left',
    iconCls: 'home',
    iconMask: true,
    ui : 'plain'
  }
},

As I tested, I see only home icon there - nothing else.

Upvotes: 1

Related Questions