2
我試圖讓TabGroup的第一個和最後一個選項卡被禁用,所以我可以給他們自定義功能而不是切換視圖。我試過touchEnabled = false和其他東西的handfull,我似乎無法得到任何工作......任何想法?Titanium:禁用TabGroup中的選項卡
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;
感謝您的幫助......我最終爲它建立了自定義視圖。 – JasonGroulx