In Titanium SDK before 2.0 the following snippet worked like a charm on iOS Apps:
var label = Titanium.UI.createLabel({
text: 'Sample Text',
width: 'auto'
});
alert(label.width); // shows the pixel width of the label
With the new release of the 2.0+ SDK this seems to no longer be supported.
Is there a different approach available that does not involve events such as postlayout? Events will need a ansync. handling which adds too much work to the creation of views.
The solution is dirty and more or less a workaround:
… represents the width by creating an image of the label first.