开发者

Flex 4 richeditabletext word wrap

I'm trying to word wrap a richeditable text but I'm having some problems:

Flex 4 richeditabletext word wrap

I want it to wrap vertically so I can avoid the horizontal scrollbar.

The Air app only has a spark list and the itemrenderer used is this:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx" 
                autoDrawBackground="true">

    <s:RichEditableText width="100%" height="100%" multi开发者_运维问答line="true" text="{data.text}"/>

</s:ItemRenderer>

Any ideas ho to fix this? Thank you.


Add minWidth to your text component like so:

<s:RichEditableText width="100%" height="100%" minWidth="0" multiline="true" text="{data.text}"/>

This is an old trick to force a component to calculate its size properly.


lineBreak property seems to work for flex 4.5 in actionscript and mxml, but only in mxml in previous versions.

<s:RichEditableText lineBreak="toFit"  width="100%" height="100%" multiline="true" text="{data.text}" />


Set the ItemRenderer width to 100%:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx"
                autoDrawBackground="true"
                width="100%">

    <s:Label width="100%" text="{data.text}"/>

</s:ItemRenderer>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜