Flex在平时的使用的过程中,我们会用到DateChooser控件,这个控件最早是使用E文的,为了能显示出中文,以及设置一些样式,
我这里设置了DateChooser。不用多说,帖上代码:
<mx:DateChooser x="139" y="83" borderColor="green"
change="datechooser1_changeHandler(event)"
click="datechooser1_clickHandler(event)"
dayNames="[日,一,二,三,四,五,六]"
headerColors="{[0xE1E56B, 0x04F5F7 ]}"
headerStyleName="myHeaderStyle"
monthNames="[一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月]"
scroll="changeMonth(event)"
selectedRanges="{{rangeStart:new Date(2011,7,12),rangeEnd:new Date(2007,10,10)}}"
todayColor="#CCCCCC" todayStyleName="myTodayStyle" weekDayStyleName="myDayStyle" yearNavigationEnabled="true"/>
而且里面用到了一些样式:
在css文件中写入
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.yahei{
font-family:"Microsoft Yahei",Georgia;
}
.myHeaderStyle{
color:#6666CC;
font-family:Times New Roman, Times, serif;
font-size:16px; font-weight:bold;
}
.myTodayStyle{
color:#CC6633;
font-family:Times New Roman, Times, serif;
font-size:12px; font-weight:bold;
}
.myDayStyle{
color:#006600;
font-family:Courier New, Courier, mono;
font-size:15px; font-style:italic; font-weight:bold;
}
最终的显示效果如下:
(待续..................................................................................)
时不我待.