How wordwrap in flex tree node
I have a Tree object in my Flex code. The width is 100% and it is contained in a panel with width = 200. I am using a custom itemrenderer that extends TreeItemRenderer.
I need the text in each node to wrap words if it's too big (as is often the case). I tried
label.wordWrap = true;
in my things renderer with no luck. Any other suggestions?
If "label" is an instance of a Label component, you cannot wrap it no matter what you do, since the Label component does not support wrapping. Or rather, intended to be used for single line text only.
If you are using the Label component, try using the Text component. It is designed to display multi-line text.
a source to share
try setting the width of the labels to a constant width. If you can't do that because it needs to be dynamic, you need to override the update functions and then set the width of the label. The problem is that the label hasn't calculated its actual 100% width at render time, so it doesn't know if it should warp or not.
a source to share