Skip to content

Instantly share code, notes, and snippets.

@pegli
Created July 2, 2012 21:23
Show Gist options
  • Save pegli/3035796 to your computer and use it in GitHub Desktop.
Save pegli/3035796 to your computer and use it in GitHub Desktop.
function ApplicationTabGroup(Window) {
var MusicWindow = require('ui/handheld/MusicWindow'),
VideosWindow = require('ui/handheld/VideosWindow'),
SearchWindow = require('ui/handheld/SearchWindow');
//create module instance
var self = Ti.UI.createTabGroup();
//create app tabs
var win1 = new MusicWindow(L('music')),
win2 = new VideosWindow(L('videos')),
win3 = new SearchWindow(L('search'));
var tab1 = Ti.UI.createTab({
title: L('home'),
icon: '/images/KS_nav_ui.png',
window: win1
});
win1.containingTab = tab1;
var tab2 = Ti.UI.createTab({
title: L('settings'),
icon: '/images/KS_nav_views.png',
window: win2
});
win2.containingTab = tab2;
var tab3 = Ti.UI.createTab({
title: L('settings'),
icon: '/images/KS_nav_views.png',
window: win3
});
win3.containingTab = tab3;
self.addTab(tab1);
self.addTab(tab2);
self.addTab(tab3);
return self;
};
module.exports = ApplicationTabGroup;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment