下面是我的相同代码.它适用于iPhone,但图像是为 Android拉伸的,所以它没有显示标签. var friendsButton = Titanium.UI.createButton({ top : 0, left : 91, width : 90, height : 101, style : 0, backgroundImage : '/img/but
var friendsButton = Titanium.UI.createButton({
top : 0,
left : 91,
width : 90,
height : 101,
style : 0,
backgroundImage : '/img/buttonMiddle.png',
image : '/img/friendcopy.png'
});
var friendLabel = Titanium.UI.createLabel({
top : 35,
left : 25,
width : 100,
height : 100,
text : 'Friend',
color : 'white',
font : {fontSize:12}
});
friendsButton.add(friendLabel);
请帮帮我.我是Titanium的新手
尝试在Android中设置所有对象(butttons / labels)属性,如:var friendLabel = Titanium.UI.createLabel({
top : '35dp',
left : '25dp',
width : '100dp',
height : '100dp',
text : 'Friend',
color : 'white',
font : {fontSize:'12dp'}
});
希望这可以帮助.
