Flex SDK mx:Text component word wrap bug fix
If you're having trouble getting word wrapping to work correctly in your mx:Text components when using minWidth
and maxWidth
, and setting width
to a percentage (e.g., minWidth="0" maxWidth="300" width="100%"
), it's not you, it's the Flex SDK (see bug 12826, reported by Tom Bray).
The fix, as provided by Mike Schiff, has been implemented in the SDK but until it is released you can extend mx:Text
and implement it in your own projects:
<mx:Script>
<![CDATA[
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
textField.wordWrap = textField.wordWrap || (Math.floor(measuredWidth) != Math.floor(width));
}
]]>
</mx:Script>
Comments
by localToGlobal » Blog Archive » news review -> 6th week of 2009 on 2009-02-06 16:57:47
by Tyler Smith on 2009-04-05 03:31:15
by How to Get Six Pack Fast on 2009-04-15 13:54:47
by Niels Bjerg on 2009-03-31 14:10:19
by peter on 2011-03-08 08:58:52