Flex Gumbo中如何通过textJustify样式设置TextBox文字对齐的例子
By Minidxer | June 9, 2009
接下来的例子演示了Flex Gumbo中如何通过textJustify样式,设置TextBox文字对齐。
编译本例需要Flex Gumbo build 4285 (4.0.0.4285)版本。
下面是实现代码:
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <Application name="TextBox_textJustify_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- layout="vertical"
- verticalAlign="top"
- backgroundColor="white">
- <ApplicationControlBar dock="true">
- <Form styleName="plain">
- <FormItem label="textJustify:">
- <ComboBox id="comboBox"
- dataProvider="[distribute,interWord]" />
- </FormItem>
- <FormItem label="width:">
- <HSlider id="slider"
- minimum="300"
- maximum="550"
- value="500"
- snapInterval="1"
- tickInterval="25"
- liveDragging="true" />
- </FormItem>
- </Form>
- </ApplicationControlBar>
- <Graphic>
- <TextBox id="textBox"
- textAlign="justify"
- textJustify="{comboBox.selectedItem}"
- width="{slider.value}">
- <text><String source="data/lorem.txt" /></text>
- </TextBox>
- </Graphic>
- </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, TextBox |
No Comments » |
Tags: Gumbo, TextBox, textJustify