Flex中按钮颜色相关的color, disabledColor, textRollOverColor和textSelectedColor样式的例子
By Minidxer | August 12, 2008
接下来的例子演示了Flex中利用color, disabledColor, textRollOverColor和textSelectedColor样式,设置有效状态和无效状态下按钮颜色。
让我们先来看一下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="middle"
- backgroundColor="white">
- <mx:ApplicationControlBar dock="true">
- <mx:Label text="color:" />
- <mx:ColorPicker id="colorCB" />
- <mx:Spacer width="33%" />
- <mx:Label text="textRollOverColor:" />
- <mx:ColorPicker id="textRollOverColorCB" />
- <mx:Spacer width="33%" />
- <mx:Label text="textSelectedColor:" />
- <mx:ColorPicker id="textSelectedColorCB" />
- <mx:Spacer width="33%" />
- <mx:Label text="disabledColor:" />
- <mx:ColorPicker id="disabledColorCB" />
- <mx:CheckBox id="enabledCh" label="enabled" selected="true" />
- </mx:ApplicationControlBar>
- <mx:Button id="button"
- label="Label"
- toggle="true"
- enabled="{enabledCh.selected}"
- color="{colorCB.selectedColor}"
- disabledColor="{disabledColorCB.selectedColor}"
- textRollOverColor="{textRollOverColorCB.selectedColor}"
- textSelectedColor="{textSelectedColorCB.selectedColor}" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Flex |
Tags: Button, Color, disabledColor, textRollOverColor, textSelectedColor