<mx:Script>
<![CDATA[
import mx.core.UITextField;
private function setDayStyles():void{
var dateField :UITextField;
var colIndex : int;
var rowIndex : int;
dateChooser.mx_internal::dateGrid.height = 148;
dateChooser.mx_internal::dateGrid.width = 176;
//Change background for weekday name row
for(colIndex = 0; colIndex < 7; colIndex++){
dateField = dateChooser.mx_internal::dateGrid.mx_internal::dayBlocksArray[colIndex][0] as UITextField;
dateField.background = true;
dateField.border = true;
dateField.backgroundColor = 0xCCCCCC;
dateField.borderColor = 0xCCCCCC;
}
//set border for day labels
for(rowIndex = 1; rowIndex < 7; rowIndex++){
for(colIndex = 0; colIndex < 7; colIndex++){
dateField = dateChooser.mx_internal::dateGrid.mx_internal::dayBlocksArray[colIndex][rowIndex] as UITextField;
dateField.border = true;
dateField.borderColor = 0xCCCCCC;
}
}
}
]]>
</mx:Script>
<mx:HBox horizontalGap="15" styleName="padding10Style">
<mx:DateChooser id="dateChooser" initialize="setDayStyles()"/>
</mx:HBox>
</mx:Application>
我正面临大胆的边界问题。以下是供您参考的代码片段:
我试图动态设置边界,因为这是 UITextFiled ,这是不可能的。