Create overlapping images?

You must Login before you can answer or comment on any questions.

Hey

how do i create overlapping images?

That is, given a view like so:

var imgView = Ti.UI.createView({
            width: Ti.Platform.displayCaps.platformWidth*0.28,
            layout: 'horizontal',
            horizontalWrap: false,
        });
and this loop:
for (var j = 0; j < number; j++){
            imgView.add(Ti.UI.createImageView({
                left: j*0.15*imgView.width,
                top: 0,
                image: someImageHere,
                width: 'auto',
                zIndex: number-j,
            })); 
        }
how do i get it so the images are overlapping?

That is, the first is at left: 0, the second a bit to the right of (and under), the first, and so on?

Currently i just get the images sitting beside each other, not overlapping. Is there some sort of overlap flag i need to turn on?

— asked 7 months ago by lord bharal
3 Comments
  • I believe this due to the layout you chose for your container view. Try to do:

    var imgView = Ti.UI.createView({
         ….
         layout: 'composite',
        …..
    });

    — commented 7 months ago by Thierry Godfroid

  • oops. I meant this as an answer not a comment. Sorry.

    — commented 7 months ago by Thierry Godfroid

  • fantastic, you are correct.

    — commented 7 months ago by lord bharal

1 Answer

As Thierry notes, i needed to use the "composite" layout

Your Answer

Think you can help? Login to answer this question!