在Titanium Appcelerator中,是否支持基于URL的tabGroups?

时间:2011-06-25 15:53:00

标签: javascript android titanium appcelerator

如果有,Titanium.UI.currentWindow是什么类似物?

例如,为了引用不同文件中的窗口,我们可以使用

Ti.UI.createWindow({url: 'foo.js'});

并在foo.js中,指向当前窗口变量

win = Ti.UI.currentWindow;

是否有类似的方法从另一个文件调用选项卡组?

2 个答案:

答案 0 :(得分:2)

您始终可以使用Ti.UI.currentTab来获取您所在的标签,但不能使用标签组。获取tabGroup的简单方法是将其作为属性添加到窗口中。

var tabGroup = Ti.UI.createTabGroup();
var window = Ti.UI.createWindow({
     url: 'foo.js',
     _tabGroup: tabGroup
});

然后在你.js文件

var tabGroup = Ti.UI.currentWindow._tabGroup;
var win = Ti.UI.currentWindow;

答案 1 :(得分:0)

您实际上可以Ti.UI.currentTabGroup