I droped into a behaviour which i didnt expect, please explain me to understand and fix it.
– The issue is as follow : I have a class which holds a label, and this class is used inside a itemRenderer as , the whole thing work withotu exception, but it doest not show the text of the label.
I have tried with adding a Button but the issue remains – it never actually add an the button.
Why?
public class BusTreeNode extends UIComponent
{
protected var label : Label;
public function BusTreeNode()
{
super();
label = new Label();
this.addChild( label );
label.x = 40;
label.y = 2;
label.text = "test";
}
}
… Inside itemRenderer :
<sl:BusTreeNode width="100%" />
I suppose the problem is you haven’t
measure()implementation in yourBusTreeNodeclass. So your component has 0x0 size by default. This declaration:still give 0 as height.
You can read more about Flex components measuring here. And this article is very useful for creating custom components.