Skip to content

Instantly share code, notes, and snippets.

@shinriyo
Created August 15, 2012 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinriyo/3354737 to your computer and use it in GitHub Desktop.
Save shinriyo/3354737 to your computer and use it in GitHub Desktop.
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
title: "win 1",
backgroundColor: "blue"
});
var data = [
{title:'Album 1', hasChild:true, dest:'album_1.js'},
{title:'Album 2', hasChild:true, dest:'album_2.js'},
];
var table = Ti.UI.createTableView({
data:data
});
table.addEventListener('click', function(e){
if(e.rowData.hasChild) {
var w = Ti.UI.createWindow({
url: e.rowData.dest,
title: e.rowData.title,
backgroundColor: 'white'
});
tab1.open(w);
}
});
var view = Ti.UI.createView();
view.add(table);
win1.add(view);
// 追加
win1.open();
var win2 = Ti.UI.createWindow({
title: "win 2",
backgroundColor: "red"
});
var tab1 = Ti.UI.createTab({
icon: "KS_nav_views.png",
title: "Tab 1",
window: win1
});
/*
var tab2 = Ti.UI.createTab({
icon: "KS_nav_ui.png",
title: "Tab 2",
window: win2
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment