Flex 4中如何通过baseColor样式设置DropDownList基本肤色的例子

By Minidxer | October 22, 2009

接下来的例子演示了Flex 4中如何通过baseColor样式,设置DropDownList基本肤色。



下面是main.mxml:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application name="Spark_DropDownList_baseColor_test"
  3.         xmlns:fx="http://ns.adobe.com/mxml/2009"
  4.         xmlns:mx="library://ns.adobe.com/flex/halo"
  5.         xmlns:s="library://ns.adobe.com/flex/spark">
  6.  
  7.     <mx:ApplicationControlBar width="100%" cornerRadius="0">
  8.         <mx:Form styleName="plain">
  9.             <mx:FormItem label="baseColor:">
  10.                 <mx:ColorPicker id="colorPicker"
  11.                         selectedColor="#CCCCCC" />
  12.             </mx:FormItem>
  13.         </mx:Form>
  14.     </mx:ApplicationControlBar>
  15.  
  16.     <s:DropDownList id="dropDownList"
  17.             baseColor="{colorPicker.selectedColor}"
  18.             requireSelection="true"
  19.             horizontalCenter="0"
  20.             top="50">
  21.         <s:dataProvider>
  22.             <s:ArrayList>
  23.                 <fx:String>(1) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  24.                 <fx:String>(2) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  25.                 <fx:String>(3) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  26.                 <fx:String>(4) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  27.                 <fx:String>(5) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  28.                 <fx:String>(6) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  29.                 <fx:String>(7) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  30.                 <fx:String>(8) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  31.                 <fx:String>(9) The Quick Brown Fox Jumps Over the Lazy Dog</fx:String>
  32.             </s:ArrayList>
  33.         </s:dataProvider>
  34.     </s:DropDownList>
  35.  
  36. </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: DropDownList, Gumbo | 1 Comment » | Tags: ,

Search Posts