Flex Gumbo中如何通过restrict属性限制TextInput输入特定字符的例子
By Minidxer | August 19, 2009
接下来的例子演示了Flex Gumbo中如何通过restrict属性,限制TextInput输入特定字符。
下面是完整代码(或点击这里察看):
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="Spark_TextInput_restrict_test"
- xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark">
- <s:VGroup horizontalCenter="0" verticalCenter="0">
- <s:SimpleText text="Allowed characters are 0-9 and A-F:" />
- <s:TextInput id="textInput"
- restrict="0-9A-F"
- widthInChars="20"
- maxChars="20" />
- </s:VGroup>
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, TextInput |
No Comments » |
Tags: Gumbo, restrict