Quantcast
Viewing latest article 6
Browse Latest Browse All 8

Custom toolbar on a tabbed window

Hi there,

I'm still stuck on something that may either not be possible or really easy to do.

I have a very simple app with a TabGroup, 4 tabs pointing to 4 windows.

When selecting a tab, the appropriate window is displayed -- on this view there is a title bar with the name of the tab.

My question is how to I place a custom toolbar or buttonbar on this title bar (removing the title text, I don't need it).

The only thing that works for me is creating a buttonbar and then using win1.setLeftNavButton(navBar). However, even after increasing the width of this "navBar" -- it's not really centered and looks like a hack.

Is there a better / easier / normal way of doing this? The real issue here is that by default there is a titlebar shown when clicking on a tab, removing that titlebar to replace it with a toolbar could maybe solve this issue.. but I'm not able to remove it anyway.

Looking forward to some tips, thank you very much!

David

Sample Code:

var tabGroup = Titanium.UI.createTabGroup();

var navBar = Titanium.UI.createButtonBar({ labels:['label 1', 'label 2', 'label 3'], style:Titanium.UI.iPhone.SystemButtonStyle.BAR, top:0, index: 0, width: 350 }); var win1 = Titanium.UI.createWindow({
title:'', backgroundColor:'#fff' }); var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab #1', window:win1 }); win1.setLeftNavButton(navBar);

tabGroup.addTab(tab1); tabGroup.open();


Viewing latest article 6
Browse Latest Browse All 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>