简体   繁体   English

如何在Titanium.UI.CreateButtonBar上将图像添加为标签?

[英]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

      });

The labels attribute can also be an array of BarItemType labels属性也可以是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
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM