I have a problem with a window that contains a TabGroups "there are 5 tabs"
the window and there appears that the window of the first tab that appears but when I clik on anything else happens.
I have a main window that contains views and each view re开发者_如何学Pythonfers to a file js
js file contents that I have after clicking my view is the one I just posted
In addition to the icons of the tab does not appear as
Another concern the back button when I click on it nothing happens and I can not assign an image to this button here
can you help me please
here is the code
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('white');
// create tab group
var tabGroup = Titanium.UI.createTabGroup({
barColor:'black'
});
// create base UI tab and root window
var win1= Titanium.UI.createWindow({
//modal:true,leftNavButton:boutonRetour, // ajout bouton retour
title:'Récentes',
backgroundColor:'white'
});
//win.add(boutonRetour);// bouton retour
var var1 = Titanium.UI.createTab({
icon:'images/icons/recentes_off.png',
title:'var1',
window:win1
});
var win2= Titanium.UI.createWindow({
title:'var2',
backgroundColor:'white'
});
var var2 = Titanium.UI.createTab({
//icon:'recentes_on.png',
title:'var2',
window:win2
});
var win3= Titanium.UI.createWindow({
title:'var3',
backgroundColor:'white'
});
var var3 = Titanium.UI.createTab({
//icon:'recentes_on.png',
title:'Thèmes',
window:win3
});
var win4 = Titanium.UI.createWindow({
title:'var4',
backgroundColor:'white'
});
var var4 = Titanium.UI.createTab({
//icon:'recentes_on.png',
title:'var4',
window:win4
});
var win5 = Titanium.UI.createWindow({
title:'var5',
backgroundColor:'white'
});
var var5 = Titanium.UI.createTab({
// icon:'recentes_on.png',
title:'var5',
window:win5
});
// add tabs------------------------------------------
tabGroup.addTab(var1);
tabGroup.addTab(var2);
tabGroup.addTab(var3);
tabGroup.addTab(var4);
tabGroup.addTab(var5);
// open tab group-----------------------------------------
tabGroup.open();
// -------------------ajout bouton Retour --------------------
var ButtonRetour = Ti.UI.createButtonBar({
labels: ['Retour'],
backgroundColor: '#ae4041',
backgroundImage: 'images/back.png',
color: '#ffffff'
});
ButtonRetour.addEventListener('click', function(){
win.close();
});
win1.leftNavButton = ButtonRetour;
// ---------------fin --------------------
none of your windows have a URL to tell Ti where to get the js file
Ti.UI.createWindow({
url: 'link/to/js/file.js',
title: 'Window Title',
backgroundColor: '#fff'
});
each of your windows defined need to have a URL if you are going to link to them by added them to a tab like so window: win1
as for the icon no showing up the image path is probably incorrect.
精彩评论