Flex中如何通过backgroundDisabledColor样式设置List控件无效状态下标签颜色的例子

By Minidxer | July 22, 2008

在前面的Flex中如何通过backgroundDisabledColor样式改变List控件无效状态下背景颜色的例子中,我们了解了List控件无效状态下背景颜色的设置,接下来的例子演示了Flex中如何通过backgroundDisabledColor样式,设置List控件无效状态下标签颜色。

让我们先来看一下Demo可以右键View Source或点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="top"
  5.         backgroundColor="white">
  6.  
  7.     <mx:Array id="arr">
  8.         <mx:Object label="One" />
  9.         <mx:Object label="Two" />
  10.         <mx:Object label="Three" />
  11.         <mx:Object label="Four" />
  12.         <mx:Object label="Five" />
  13.         <mx:Object label="Six" />
  14.         <mx:Object label="Seven" />
  15.         <mx:Object label="Eight" />
  16.         <mx:Object label="Nine" />
  17.         <mx:Object label="Ten" />
  18.     </mx:Array>
  19.  
  20.     <mx:ApplicationControlBar dock="true">
  21.         <mx:Form styleName="plain">
  22.             <mx:FormItem label="disabledColor:">
  23.                 <mx:ColorPicker id="colorPicker"
  24.                         selectedColor="#999999" />
  25.             </mx:FormItem>
  26.             <mx:FormItem label="enabled:">
  27.                 <mx:CheckBox id="checkBox"
  28.                         selected="true" />
  29.             </mx:FormItem>
  30.         </mx:Form>
  31.     </mx:ApplicationControlBar>
  32.  
  33.     <mx:List id="list"
  34.             dataProvider="{arr}"
  35.             enabled="{checkBox.selected}"
  36.             disabledColor="{colorPicker.selectedColor}"
  37.             width="100" />
  38.  
  39. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:minidxer

Topics: Flex | Tags: , ,

Related Post

Leave a Comment

Name(*):

E-Mail(*) :

Website :

Comments :

Search Posts

Archives

Sponsored Ads