Flex Gumbo中如何通过lineBreak样式设置Spark TextArea自动换行的例子
By Minidxer | July 4, 2009
接下来的例子演示了Flex Gumbo中如何通过在lineBreak样式中设置flashx.textLayout.formats.LineBreak类的静态constants,实现Spark TextArea自动换行。
下面是代码:
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="Spark_TextArea_lineBreak_test"
- xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/halo">
- <mx:ApplicationControlBar cornerRadius="0" width="100%">
- <mx:Form styleName="plain">
- <mx:FormItem label="lineBreak:">
- <s:DropDownList id="comboBox" requiresSelection="true">
- <s:dataProvider>
- <s:ArrayList source="[toFit,explicit]" />
- </s:dataProvider>
- </s:DropDownList>
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <s:TextArea id="textArea"
- lineBreak="{comboBox.selectedItem}"
- fontSize="16"
- horizontalCenter="0"
- verticalCenter="0">
- <s:content>
- <s:p>1. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>2. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>3. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>4. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>5. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>6. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>7. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>8. The quick brown fox jumps over the lazy dog.</s:p>
- <s:p>9. The quick brown fox jumps over the lazy dog.</s:p>
- </s:content>
- </s:TextArea>
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FxTextArea, Gumbo |
1 Comment » |
641 views
Tags: content, Gumbo, lineBreak, Text, TextArea (Spark)
请问一个和有什么区别~~