我试图让 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;