views:

32

answers:

2

Hello,

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

word wrap richeditabletext

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%" multiline="true" text="{data.text}"/>

</s:ItemRenderer>

Any ideas ho to fix this? Thank you.

A: 

Untested, but try:

<s:RichEditableText lineBreak="toFit"  width="100%" height="100%" multiline="true" text="{data.text}" />
Marty Pitt
Thank you Marty, still no luck.
Artur Carvalho
+1  A: 

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.

Wade Mueller
Finally it works! Thank you very much Wade!
Artur Carvalho
Excellent, glad I could help.
Wade Mueller