This is my code thus far. I have a button bar with two options. I would like to change the color of the second option. I’m not quite sure how to accomplish this. I was able to set up the click function by checking the index, but unsuccessful in trying to change the colors.
var headerEmail = Titanium.UI.createButtonBar({
labels:['cory@gmail.com', 'Logout'],
backgroundColor:(labels[0] == 0) ? '#000' : '#fff'
});
headerEmail.addEventListener('click', function(e){
//alert(e.index);
if(e.index == 1){
var LoginWindow = require('/ui/LoginWindow')();
LoginWindow.open();
TabContainer.close();
}
});
Have tried with headerEmail.children[1], i mean you can try like this,