Search code examples
titaniumappceleratortitanium-mobileappcelerator-mobile

Change the HTML5 left navigation button title in Titanium


I am Using titanium classic for my HTML5 application. I would like to change the left navigation button having a title "Back" to the title "Cancel". I have tried to update the button using "leftNavButton" property, but of no use. Can any one please let me know how to change the text.

Thanks, Swathi.


Solution

  • Can you post a sample of your code?

    Typically you need to add a Ti.UI.Button with the attributes you want (plus event handler), then assign this to the Window.leftNavButton property.

    So:

    var button = Ti.UI.createButton({title:'Cancel'});
    
    button.addEventListener('click', function(){
     // handle it here
    });
    
    // assuming you have the window in 'win' variable
    win.leftNavButton = button;