简体   繁体   English

如何在Flex 4中为mx:DateChooser换肤

[英]How to skin an mx:DateChooser in Flex 4

I found these properties: 我发现这些属性:

selectionIndicatorSkin="..."
todayIndicatorSkin="..."

Which skins the DateChooser Selected and todays item. DateChooser Selected和今天的项目的外观。

Oddly enough I didn't find a way where I can specifiy the skin for regular days! 奇怪的是,我没有找到可以指定日常皮肤的方法! I found this property: 我发现此属性:

weekDayStyleName="..."

so I created a style 所以我创造了一种风格

.myStyle{
    skin-class: ClassReference("com.mySkin");
}

then used it: weekDayStyleName="myStyle" But it didn't work! 然后使用它:weekDayStyleName =“ myStyle”但这没有用! Any ideas? 有任何想法吗?

Extra Code: 附加代码:

<mx:DateChooser id="date1" 
                todayStyleName="myTodayStyle"
                headerStyleName="myHeaderStyle"
                selectionIndicatorSkin="com.skins.calendar.SelectionIndicatorSkin"
                todayIndicatorSkin="com.skins.calendar.TodayIndicatorSkin1"
                focusSkin="com.skins.calendar.TodayIndicatorSkin1"
                rollOverIndicatorSkin="com.skins.calendar.SelectionIndicatorSkin"
                weekDayStyleName="weekdayStyle"
                borderColor="#FFFFFF"
                todayColor="#FFFFFF"
                width="275" height="275" />

<fx:Style >
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace vld "com.lal.validators.*";
    @namespace effect "com.lal.effects.*";
    @namespace components "com.lal.components.*";



    .weekdayStyle{
        skin-class: ClassReference("com.lal.skins.calendar.TodayIndicatorSkin1");
        vertical-align: middle;
        font-size: 18;
    }
</fx:Style> 

I'm pretty sure that all the days in a DateChooser class are UITextFields . 我很确定DateChooser类中的所有日子都是UITextFields

UITextFields do not have a style named skin-class. UITextFields没有名为skin-class的样式。 Check out all styles for the UITextField class . 查看UITextField类的所有样式

As such, your style is probably ignored. 因此,您的样式可能会被忽略。

Many Flex 4 Spark components have a style named skinClass which you use to set the skin class of the component, but I didn't think such a thing existed for MX Components. 许多Flex 4 Spark组件都有一个名为skinClass的样式,可用于设置组件的外观类,但是我认为MX Components不存在这种样式。

You should be able to customize the look and feel of days by creating your own custom class that implements the IUITextField and then set that as a style with the textFieldClass style. 通过创建自己的实现IUITextField的自定义类,然后使用textFieldClass样式将其设置为样式,您应该能够自定义日子的外观。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM