Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked June 6th 2010 by Yaniv Nagar
  • position left window images
0 Comments

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.

    — answered June 6th 2010 by Sj Singh
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.