Below is my code for the same. It's working perfectly for iPhone but images are stretched for Android so its not showing label.
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);
Please help me in this. I am new to Titanium
Try to set all object (butttons/labels) properties in Android like:
var friendLabel = Titanium.UI.createLabel({
top : '35dp',
left : '25dp',
width : '100dp',
height : '100dp',
text : 'Friend',
color : 'white',
font : {fontSize:'12dp'}
});
Hope this helps.