• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>Flex>文章内容
  • Flex中如何通过设置backgroundColor和backgroundAlpha改变DateChooser控件背景颜色的
  • 来源:minidx.com 作者:minidx 2008-05-05 【

接下来的例子演示了如何通过设置backgroundColor和backgroundAlpha样式,来改变DateChooser控件的背景颜色。

让我们先来看一下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="middle"
  5.         backgroundColor="white">
  6.  
  7.     <mx:ApplicationControlBar dock="true">
  8.         <mx:Form styleName="plain">
  9.             <mx:FormItem label="backgroundAlpha:">
  10.                 <mx:HSlider id="slider"
  11.                         minimum="0"
  12.                         maximum="1"
  13.                         value="1"
  14.                         liveDragging="true"
  15.                         snapInterval="0.01"
  16.                         tickInterval="0.1" />
  17.             </mx:FormItem>
  18.             <mx:FormItem label="backgroundColor:">
  19.                 <mx:ColorPicker id="colorPicker"
  20.                         selectedColor="white" />
  21.             </mx:FormItem>
  22.         </mx:Form>
  23.     </mx:ApplicationControlBar>
  24.  
  25.     <mx:DateChooser id="dateChooser"
  26.             backgroundAlpha="{slider.value}"
  27.             backgroundColor="{colorPicker.selectedColor}" />
  28.  
  29. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:minidxer




上一篇:Flex 中 12 个简单但是很有用的函数   下一篇:没有了
您的评论
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)