Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (disabled)
Viewing all articles
Browse latest Browse all 17

Disabled TabbedBar button wont stay disabled on iPhone

$
0
0

Hi,

Ive run into a strange issue with the TabbedBar on the iPhone (I havent tested on anything else yet) which maybe a bug, but I hope its just me being daft! It seems you can only set a tab button to be disabled as long as you do not set any of the other tab buttons to be selected 'in code'. As an example, consider the following:

var tabs = [{title: 'Tab 1', enabled: true }, 
            {title: 'Tab 2', enabled: false }];
 
var myTabbedBar = Ti.UI.createTabbedBar({
   labels: tabs,
   style:Titanium.UI.iPhone.SystemButtonStyle.BAR
});
Works as expected. Both tab buttons are created, the first tab button is enabled and the second tab button is disabled (note: neither tab button is selected!). However, by selecting a default tab button using:
var myTabbedBar = Ti.UI.createTabbedBar({
   labels: tabs,
   index: 0,
   style:Titanium.UI.iPhone.SystemButtonStyle.BAR
});
Or by setting the selected index:
myTabbedBar.index = 0;
Results in all tab buttons becoming enabled.

Has anyone else seen this? - As yet, I haven't found a solution.

Thanks


Viewing all articles
Browse latest Browse all 17

Trending Articles