Error positioning in a window
I've loaded a picture into a window (a piano image):
var piano_image = Titanium.UI.createImageView({
url:"piano_bg.jpg",
top:140
});
win1.add(piano_image);
I had to put top:140 altough I tought bottom:0 should do the trick…
In addition, if I want to put another image inside, suppose I want to load an image on the most left note of the piano, I need to use a negative value of left:
var key_image = Titanium.UI.createImageView({
url:"piano_" + keys[i][0] + ".png",
top:140,
left:-390
});
win1.add(key_image);
Why aren't the units start from 0?
1 Answer
-
Accepted Answer
Try setting the height, I had this problem with labels, for some reason, they were centering so I had to -40 just to set on the top. But fixed after setting a height.