views:

27

answers:

0

Hi guys,

Quick one for any developers using appcelerator out there. I have two labels (This may even bew wrong) which are populated from an RSS feed. One label houses the title and another the description. The content for these comes from an RSS list which all works fine. THe issue I'm having is that some titles are longer than others so I cant fix label heights or it just wont work.

So with that in mind I set the titles height to be auto. The only problem is I cant reference this height from my second label to use the top: property to space it correctly.

Has anyone got any good suggestions?, Am I using the wrong type of Titanium UI method?

My current code is as follows

try
{
var current = Titanium.UI.currentWindow;
var selectedItem = current.item;
var description = selectedItem.getElementsByTagName("description");
var story = description.item(0).text;


var label = Ti.UI.createLabel({
                    text:selectedItem.getElementsByTagName("title").item(0).text,
                    left:5,
                    top:0,
                    height:"auto",
                    font:{fontSize:40}
                });
current.add(label);

var story = Ti.UI.createLabel({
                    text:story,
                    left:5,
                    top:label.height,
                    height:"auto"
                });
label.add(story);

}
catch(E)
{
 alert(E)
}