创建选项卡的问题
我对包含 TabGroups 的窗口有问题,“有 5 个选项卡”
,该窗口似乎出现第一个选项卡的窗口,但当我单击其他任何内容时会发生。
我有一个包含视图的主窗口,每个视图都引用一个文件 js
单击视图后我拥有的 js 文件内容是我刚刚发布的
除了选项卡的图标之外,
另一个问题是后退按钮我点击它没有任何反应,我无法在这里为该按钮分配图像,
您可以帮助我吗?
这是代码
// 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 --------------------
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 refers 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 --------------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的所有窗口都没有一个 URL 来告诉 Ti 在哪里获取 js 文件,
如果你打算通过将它们添加到选项卡中来链接到它们,那么每个定义的窗口都需要有一个 URL,如下所示
window: win1
至于图标没有显示图像路径可能是不正确的。
none of your windows have a URL to tell Ti where to get the js file
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.