views:

9

answers:

0

I am having trouble getting the following code to render as I expect it to:

var img = Titanium.UI.createImageView({
  top: 0,
  left: 0,
  width: 140,
  height: 92,
  image: 'http://cdn.monmotors.com/tn_' + imgr,
  defaultImage: 'car.png'
});

post_view.add(img);

var lbl = Titanium.UI.createLabel({
  text: desc,
  left: 160,
  width: 'auto',
  top: 0,
  height: 92,
  textAlign: 'left',
  color: '#ffffff',
  font: {
    fontSize: 12,
    fontWeight: 'bold'
  },
});

post_view.add(lbl);

This is how it is rendering:

Android Screenshot

I've set top: 0 and I assumed this would put the label at the top, but this is obviously not the case.

Anyone have any idea how I can achieve this? Thanks in advance.