Titanium:禁用TabGroup中的选项卡

时间:2012-10-04 14:17:13

标签: tabs titanium appcelerator

我试图让TabGroup的第一个和最后一个标签禁用,这样我就可以给它们自定义功能而不是切换视图。我尝试过touchEnabled = false和其他一些东西,我似乎无法得到任何工作......任何想法?

function TabView() {

var viewOne = require('ui/common/...');
var viewTwo = require('ui/common/...');
var viewTree = require('ui/common/...');
var self = Ti.UI.createTabGroup();

var tab1 = Titanium.UI.createTab({
    title : 'Tab 1'
});

var firstView = viewOne();
var tab2 = Ti.UI.createTab({
    title: L('firstView'),
    icon: '/images/...',
    window: firstView,
    active:true
});
firstView.containingTab = tab2;

var secondView = viewTwo();
var tab3 = Ti.UI.createTab({
    title: L('secondView'),
    icon: '/images/...',
    window: secondView
});
secondView.containingTab = tab3;

var thirdView = viewTree();
var tab4 = Ti.UI.createTab({
    title: L('Map'),
    icon: '/images/....',
    window: thirdView
});
thirdView.containingTab = tab4;

var tab5 = Titanium.UI.createTab({
    title : 'Tab 5'
});

var tabArray = [tab1, tab2, tab3, tab4, tab5];
for ( i = 0; i < tabArray.length; i++) {
    self.addTab(tabArray[i]);
}

return self;
}

module.exports = TabView;

1 个答案:

答案 0 :(得分:0)

您可以查看this帖子以禁用TabGroup中的标签。