Background back button

You must Login before you can answer or comment on any questions.

Hello! I am making an application, the basis I take the example Kitchen Sink. In app no Tabs, all done through with swipes. All registration will be created from the texture. I also want to replace the "back" button. I didthis by:

var b11 = Titanium.UI.createButton({
        title:'Back button BG',
        height:40,
        width:145,
        top:260,
        left:10
    });
 
    var colored = false;
    b11.addEventListener('click', function()
    {
        if (!colored) {
            var backbutton = Titanium.UI.createButton({
                title:'BG nav', 
                backgroundImage:'/images/chat.png',
                width:100,
                height:20
            });
            backbutton.addEventListener('click', function() {
                win.close(); //if you use it, the window itself just disappears, and a bar is.
 
                //or
                var w = require('ui/common/BaseUIWindow');
                w().open();//It works, but there is no animation.
            });
            win.leftNavButton = backbutton;
            colored = true;
        }
        else {
            win.leftNavButton = null;
            colored = false;
        }
    });
    win.add(b11);
How can this be implemented?

P.S.: Strip off the main JS - files (this is the changed files from the kitchen): app.js:

(function() {
    var osname = Ti.Platform.osname,
    version = Ti.Platform.version,
    height = Ti.Platform.displayCaps.platformHeight,
    width = Ti.Platform.displayCaps.platformWidth;
    var Window;
 
 
    if (osname === 'iphone' || osname === 'ipad') 
    {
        Window = require('ui/handheld/ios/ApplicationWindow');
    }
    var ApplicationTabGroup = require('ui/common/ApplicationTabGroup');
    var theTabGroup = new ApplicationTabGroup();
    if (osname === 'iphone' || osname === 'ipad') {
        theTabGroup.open({transition: Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT});
    }
    else{
        theTabGroup.open();
    }
 
    var MessageWindow = require('ui/common/MessageWindow'),
        messageWin = new MessageWindow();       
})();
ApplicationTabGroup.js:
var messageWin;
function ApplicationTabGroup() 
{
    var self = Ti.UI.createWindow(),
 
        BaseUIWindow = require('ui/common/BaseUIWindow');
 
    var baseUIWin = new BaseUIWindow(L('base_ui_title'));
 
    var baseUITab =  Ti.UI.iPhone.createNavigationGroup({
        title: L('base_ui_title'),
        icon: '/images/tabs/KS_nav_ui.png',
        window: baseUIWin
    });
    baseUIWin.containingTab = baseUITab;
    self.add(baseUITab);
    return self;
};
 
module.exports = ApplicationTabGroup;
Otherwise no changes.

1 Answer

Problem solved. I used TabGroup instead NavigationGroup. A TabBar I hid. P.S.: If you have any questions please contact me on Skype: MoonlightAndre. I will be glad to help.

Your Answer

This question has been locked and cannot accept new answers.