Titanium Community Questions & Answer Archive

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

position vertical labels

hi all,
we search a posibilty to set the positions of labels…
so we put different text (different lenghts) into labels. so the high of this label must be dynamic.

example

var win = Titanium.UI.currentWindow;
var body = Ti.UI.createView({height:'auto'});

var Label1 = Ti.UI.createLabel({
color:'green', 
top:10,
height:'auto', 
text:'Lorem ipsum dolor sit amet, consetetur sadipscing 
elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore 
magna aliquyam erat, 
sed diam voluptua'});

body.add(Label1);

var Label2 = Ti.UI.createLabel({
color:'red', 
top:Label1.size.height,
height:'auto', 
text:'At vero eos et accusam et justo duo 
dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est 
Lorem ipsum dolor sit amet'});

body.add(Label2);
win.add(body);

if we check the Label1.size.height we become 0!

can anybody help us????

thx

— asked June 10th 2010 by chef koch
  • label
  • position
0 Comments

1 Answer

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.