我在使用 tabGroups 时遇到问题。我创建了一个新应用程序(这是我的第一个应用程序),当我单击表中的一个选项时,我正在调用:
win.open(win,{annimated:true});
问题是页面顶部没有选项卡可以返回到我所在的位置。所以我需要使用标签组。我的问题是我不确定如何使用它们。当我将上述内容替换为:
Ti.UI.currentTab.open(win);
我收到一个未定义 currentTab 的错误。如何启用 tabGroups?我有另一个名为 AppTabGroup.js 的文件,其中包含: var self = Ti.UI.createTabGroup(); 在其中,但我不知道如何使用它。
下面是整个页面,以防我正在做一些偏离基础的事情。
函数 AppWindow(title) { var self = Ti.UI.createWindow({ title:title, backgroundColor:'white' });
var data = [
{ title:"Catalog", hasChild:true, test:'ui/CatalogWindow.js', header:'' },
{ title:"Service Calculator", hasChild:true, header:'' }
];
var tableview = Titanium.UI.createTableView({
data:data,
style:Titanium.UI.iPhone.TableViewStyle.GROUPED
});
tableview.addEventListener('click', function(e)
{
if (e.rowData.test)
{
var win =
Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title
});
win.open(win,{annimated:true});
}
}); self.add(tableview);
return self;
};
module.exports = 应用窗口;