has anyone know how to change window's view when tabbed bar is pressed in titanium? i've created tabbed bar and i don't know how to handling that event..
here's my code:
if (Titanium.Platform.osname === 'iphone'){
var headerDetailTabbedBar = Titanium.UI.iOS.createTabbedBar({
labels:['Header', 'Detail'],
backgroundColor:'#336699',
style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
top:10,
height:25,
width:'85%',
index:0
});
//View Mode
var btnBack = Titanium.UI.createButton({
title:'Back',
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
var btnEdit = Titanium.UI.createButton({
title:'Edit',
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
//Save Mode
var btnCancel = Titanium.UI.createButton({
title:'Cancel',
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
var btnSave = Titanium.UI.createButton({
title:'Save',
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
subMenuDisplayEditWindow.setLeftNavButton(btnBack);
subMenuDisplayEditWindow.setRightNavButton(btnEdit);
subMenuDisplayEditWindow.add(headerDetailTabbedBar);
headerDetailTabbedBar.addEventListener('click',function(e){
if(e.index === 0){
//What should i do?
}
else{
//What should i do?
}
});
}
all i want is to change window's view with other view when the tabbed bar is pressed.. any suggestion?? thanks in advance..