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

发布于 2024-09-28 06:13:04 字数 1471 浏览 3 评论 0原文

我找到了这些属性:

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

哪些皮肤选择了 DateChooser 和今天的项目。

奇怪的是,我没有找到一种可以指定日常皮肤的方法!我发现了这个属性:

weekDayStyleName="..."

所以我创建了一个样式

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

然后使用它: weekDayStyleName="myStyle" 但它不起作用!有什么想法吗?

额外代码:

<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 found these properties:

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

Which skins the DateChooser Selected and todays item.

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! 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> 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零崎曲识 2024-10-05 06:13:04

我很确定 DateChooser 类中的所有日期都是 UITextFields

UITextFields 没有名为 Skin-class 的样式。查看 UITextField 类的所有样式< /a>.

因此,您的风格可能会被忽略。

许多 Flex 4 Spark 组件都有一个名为 SkinClass 的样式,您可以使用它来设置组件的外观类,但我认为 MX Components 不存在这样的东西。

您应该能够通过创建自己的实现 IUITextField 的自定义类来自定义日子的外观,然后将其设置为带有 textFieldClass 样式的样式。

I'm pretty sure that all the days in a DateChooser class are UITextFields.

UITextFields do not have a style named skin-class. Check out all styles for the UITextField class.

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文