我正在尝试对丰富的文本进行自动换行,但我遇到了一些问题:
我想让它垂直换行,这样我就可以避开水平滚动条了。
Air应用程序只有一个spark列表,使用的项目渲染器如下所示:
<?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>有什么想法可以解决这个问题吗?谢谢。
发布于 2010-07-01 05:40:35
将minWidth添加到文本组件中,如下所示:
<s:RichEditableText width="100%" height="100%" minWidth="0" multiline="true" text="{data.text}"/>这是一个强制组件正确计算其大小的老把戏。
发布于 2010-07-01 02:57:56
lineBreak属性似乎适用于actionscript和mxml中的flex4.5,但仅适用于以前版本的mxml。
<s:RichEditableText lineBreak="toFit" width="100%" height="100%" multiline="true" text="{data.text}" />发布于 2012-07-17 04:39:25
将ItemRenderer宽度设置为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>https://stackoverflow.com/questions/3152292
复制相似问题