我想在DateChooser控件的日历底部显示当前日期。是否有人对DateChooser控件进行了扩展以做到这一点?
就像附图一样..。

我成功地完成了一些代码,但我仍然对如何将标签添加到数据回波器控件下面有一点想法。
package
{
import mx.controls.DateChooser;
import mx.controls.Label;
import mx.core.UITextField;
import mx.core.IUITextField;
import mx.core.UIComponent;
import mx.core.mx_internal;
import flash.display.Sprite;
public class ExtendedDateChooser extends DateChooser
{
public function ExtendedDateChooser()
{
super();
}
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var dateGrid : UIComponent = mx_internal::dateGrid;
// Code to add the label here....
// BELOW DOES NOT WORK!
/*
var label:Label = new Label();
label.text = "TEST";
label.y = dateGrid.height + 5;
label.x = 5;
this.addChildAt(label, this.getChildIndex(dateGrid));
*/
}
}
}在我的MXML中,我的控件声明如下:
<mx:DateField width="100" parseFunction="{null}" dropdownFactory="ExtendedDateChooser" />发布于 2012-03-23 17:06:47
为了干净地完成这个任务,您实际上想要扩展的是DateChooser控件,因为它表示下拉列表。
然后,您需要更改DateField控件的下拉类。
myDateField.dropdownFactory = new ClassFactory(ExtendedDateChooser);我将继续更新这个答案,因为我有时间研究。
https://stackoverflow.com/questions/9843285
复制相似问题