如何在 Flex 4 中为 mx:DateChooser 换肤
我找到了这些属性:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很确定 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.