Flex中如何通过indicatorSkin样式给FormItem设置一个自定义指示器的例子
By Minidxer | April 28, 2009
接下来的例子演示了Flex中如何通过indicatorSkin样式,给FormItem设置一个自定义指示器。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="top"
- backgroundColor="white">
- <mx:Style>
- FormItem {
- indicatorGap: 24;
- }
- </mx:Style>
- <mx:Form>
- <mx:FormHeading label="Controls" />
- <mx:FormItem label="Button:"
- required="true"
- indicatorSkin="@Embed('assets/Button.png')">
- <mx:Label text="Lorem ipsum..." />
- </mx:FormItem>
- <mx:FormItem label="ButtonBar:"
- required="true"
- indicatorSkin="@Embed('assets/ButtonBar.png')">
- <mx:Label text="Lorem ipsum..." />
- </mx:FormItem>
- <mx:FormItem label="CheckBox:"
- required="true"
- indicatorSkin="@Embed('assets/CheckBox.png')">
- <mx:Label text="Lorem ipsum..." />
- </mx:FormItem>
- <mx:FormItem label="ColorPicker:"
- required="true"
- indicatorSkin="@Embed('assets/ColorPicker.png')">
- <mx:Label text="Lorem ipsum..." />
- </mx:FormItem>
- </mx:Form>
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FormItem |
No Comments » |
762 views
Tags: FormItem, indicatorGap, indicatorSkin