Jul 20
接下来的例子演示了Flex中如何通过disabledColor样式,设置ComboBox无效状态下标签颜色。
让我们先来看一下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:Array id="arr">
- <mx:Object label="One" />
- <mx:Object label="Two" />
- <mx:Object label="Three" />
- <mx:Object label="Four" />
- <mx:Object label="Five" />
- <mx:Object label="Six" />
- <mx:Object label="Seven" />
- <mx:Object label="Eight" />
- <mx:Object label="Nine" />
- <mx:Object label="Ten" />
- </mx:Array>
- <mx:ApplicationControlBar dock="true">
- <mx:Form styleName="plain">
- <mx:FormItem label="disabledColor:">
- <mx:ColorPicker id="colorPicker"
- selectedColor="#999999" />
- </mx:FormItem>
- <mx:FormItem label="enabled:">
- <mx:CheckBox id="checkBox"
- selected="true" />
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <mx:ComboBox id="comboBox"
- dataProvider="{arr}"
- enabled="{checkBox.selected}"
- disabledColor="{colorPicker.selectedColor}" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:minidxer
