mugizico
mugizico

Reputation: 11

How can I add images as labels on Titanium.UI.CreateButtonBar?

this is my code and I want to replace "start" "pause" and "stop" with images

var controlBar = Titanium.UI.createButtonBar({
        labels: ['START','PAUSE','STOP'],
         style: Titanium.UI.iPhone.SystemButtonStyle.BAR,
         backgroundColor: '#000080',
         top:10,
         width:200,
         height:40

      });

Upvotes: 0

Views: 535

Answers (1)

mr.VVoo
mr.VVoo

Reputation: 2270

The labels attribute can also be an array of BarItemType

var controlBar = Titanium.UI.createButtonBar({
    labels: ['START','PAUSE', {
        image : '/path/to/image',
        title : 'Title',
        enabled : true
    }],
    style: Titanium.UI.iPhone.SystemButtonStyle.BAR,
    backgroundColor: '#000080',
    top:10,
    width:200,
    height:40
});

Upvotes: 1

Related Questions