problem
When assigning components to the
masterView
and
detailView
of the Ti.UI.iPad.SplitWindow component, Windows open automatically, but TabGroups require you to execute the open() call manually.
test case
The code below will render the Ti.UI.iPad.SplitWindow, but won't show the tabgroup in the masterView. Uncomment the noted line below and it will work.
var tabgroup = Ti.UI.createTabGroup();
var tab1 = Ti.UI.createTab({
title: 'tab 1',
window: Ti.UI.createWindow({
backgroundColor: '#f00',
title: 'tab 1'
})
});
var tab2 = Ti.UI.createTab({
title: 'tab 2',
window: Ti.UI.createWindow({
backgroundColor: '#0f0',
title: 'tab 2'
})
});
tabgroup.addTab(tab1);
tabgroup.addTab(tab2);
// uncomment the line below and the tabgroup will appear
// tabgroup.open();
var split = Ti.UI.iPad.createSplitWindow({
masterView: tabgroup,
detailView: Ti.UI.createWindow({
backgroundColor: '#00f'
})
});
split.open();
No comments