Flex Gumbo 通过textJustify样式设置TextBox文字对齐的例子
时间:2020-12-12 09:40:13|栏目:|点击: 次
编译本例需要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 翻译/整理/编译
下面是实现代码:
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 Gumbo 通过textJustify样式设置TextBox文字对齐的例子
本文地址:http://www.codeinn.net/misctech/31981.html