How to show selected buttonBar
Hi
I am wanting to show the selected button in a buttonBar after the user clicks on one of the button options. So when they select a button it becomes disabled, and when they select another button it becomes disabled and the other button re-enabled.
var bb1 = Titanium.UI.createButtonBar({
labels:['10', '20', '30', '40', '50', '100'],
backgroundColor:'#336699',
top:75,
style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
height:35,
width:300
});
bb1.addEventListener('click', function(e) {
// Show selected button
// and re-enable other previous disabled button
});
Could I please have some help on this :-)
Cheers
Jamesy
1 Answer
-
Use a tabbedbar instead of a buttonbar. That will allow you to show which button is selected.
var tb1 = Titanium.UI.createTabbedBar({
labels:['One', 'Two', 'Three'],
backgroundColor:'#336699',
top:50,
style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
height:25,
width:200,
index:2
});