Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Can you add a TabGroup to a SplitWindow?

I'm trying to add a TabGroup to the masterView of a SplitWindow.

Here is my code:

// WINODWS
var masterWindow = Ti.UI.createWindow({
  backgroundColor:'#fff'
});

var detailWindow = Ti.UI.createWindow({
  backgroundColor:'#fff',
  titleImage:'images/logo.png'
});

// TAB GROUP
var tabGroup = Titanium.UI.createTabGroup();

var categories = Titanium.UI.createWindow({
  title:'Categories'
});

var tabCategories = Titanium.UI.createTab({
  title:'Categories',
  window:categories
});

tabGroup.addTab(tabCategories);

masterWindow.add(tabGroup);

// DETAIL NAV GROUP
var detailNav = Ti.UI.iPhone.createNavigationGroup({
  window:detailWindow
});

// SPLIT VIEW
var splitView = Titanium.UI.iPad.createSplitWindow({
  masterView:masterWindow,
  detailView:detailNav
});

// TABS
var categories = Titanium.UI.createWindow({
  title:'Categories'
});

var newsTab = Titanium.UI.createTab({
  icon:'images/tabs/KS_nav_views.png',
  title:'Base UI',
  window:categories
});

// OPEN SPLIT WINDOW    
splitView.open();

Can this be done? Am I on the right track?

— asked August 25th 2010 by Chris Schultz
  • ipad
  • splitwindow
  • tabgroup
1 Comment
  • var splitView = Titanium.UI.iPad.createSplitWindow({
      masterView:tabGroup,
      detailView:detailNav
    });
    
    — commented August 23rd 2012 by Alex Verzen

1 Answer

  • add tabGroup.open at last line.

    — answered July 30th 2013 by li xinxin
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.