Adding button in tabGroup

You must Login before you can answer or comment on any questions.

I want to add button on the top of tabGroup. And can be seen like this picture alt text or http://imageshack.us/photo/my-images/255/unnamedi.jpg/

this picture is foursquare apps. It has 3 tabs like "friends","explore", and "me". And on the top of tab, there is label and 2 button. And as the question, how to add label and button on the top of tabGroup??

This is my code. From my code, how can i add button in it?? Because i have tried many way, but not solution. Please, help me. Because i believe that titanium can fix this problem well than other. Thanks :)

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#800000');
 
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
 
//
// make Original
//
 
var win1 = Titanium.UI.createWindow({  
    title:'Original',
    url:'tab/original.js'
}); 
 
var tab1 = Titanium.UI.createTabbedBar({ 
    icon:'KS_nav_views.png',
    title:'Original',
    window:win1
 
});
 
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Paket',
    url:'tab/paket.js'
});
var tab2 = Titanium.UI.createTabbedBar({  
    icon:'KS_nav_ui.png',
    title:'Praktis',
    window:win2
});
 
 
//
// create controls tab and root window
//
var win3 = Titanium.UI.createWindow({  
    title:'Prakstis',
    url:'tab/praktis.js'
});
var tab3 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Paket Hemat',
    window:win3
});
 
//
// create controls tab and root window
//
var win4 = Titanium.UI.createWindow({  
    title:'Praktis',
    url:'tab/minuman.js'
});
var tab4 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Paket',
    window:win4
});
 
//
//  add tabs
//
 
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
tabGroup.addTab(tab4);  
 
 
// open tab group
 
tabGroup.open();
i use android 2.2 for mobile and win 7 x32

1 Answer

For this you are going to have to create your own custom tabgroup. On android tabgroup is the root element that lays on top of any other window and it cant be added to a window. Also Titanium.UI.createTabbedBar its an iOS element only.

btw this is false on iOS in the case you want to make an iphone app

— answered 9 months ago by Arian Caraballo
answer permalink
4 Comments
  • Thank you. Whether you can tell in outline, how way it is? or can "menu" be added in it? :)

    — commented 9 months ago by yosua hendrik

  • I didnt get the question.

    — commented 9 months ago by Arian Caraballo

  • hmm, can you tell like what is own custom tabgroup ?

    — commented 9 months ago by yosua hendrik

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!