Flex 4中如何截取RichText内文字的例子
By Minidxer | September 16, 2009
接下来的例子演示了Flex 4中如何通过设置truncation属性和指定最大可见行数,截取RichText内文字。
下面是完整代码(或点击这里察看):
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="Spark_RichText_truncation_test"
- xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:mx="library://ns.adobe.com/flex/halo"
- xmlns:s="library://ns.adobe.com/flex/spark">
- <mx:ApplicationControlBar width="100%" cornerRadius="0">
- <mx:Form styleName="plain">
- <mx:FormItem label="truncation:">
- <s:HSlider id="slider"
- minimum="-1"
- maximum="22"
- liveDragging="true" />
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <s:RichText id="richText"
- truncation="{slider.value}"
- width="200"
- horizontalCenter="0" verticalCenter="0">
- <s:text><fx:String source="dummy.txt" /></s:text>
- </s:RichText>
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, RichTextEditor |
No Comments » |
Tags: Gumbo, needsSWF, truncation