Flex主题

Flex支持的样式设置方式
1.直接使用CSS文件,系统默认使用default.css
<mx:Style source=“style.css”/>
2.使用<mx:Style>标签
3.使用style设计器(->MXML)
4.使用对象的getStyle( )和setStyle( )
5.使用StyleManager类

主题是一套配置完成的样式风格
Flex提供的几种主题,文件类型.swc
建议使用.swc文件来封装主题
给编译指令添加
-theme xxx.css //注意路径
在Flex-config.xml中通过修改<theme>标签配置主题

创建自己的主题
1.通过修改以后的主题文件创建自己的主题内容
2.使用compc编译主题,生成swc文件(见帮助)
-include-file name path
-o output.swc
-include-classes
3.通过配置文件编译主题
compc -load-config myconfig.xml

添加主题具体操作(在Flex-config.xml中配置:frameworks中<theme><filename>路径</filename></themt>)

1、 先写好.css文件

2、compo -include-file css文件名 文件路径(绝对路径) -include-file 可以有多个

-o 要放置的路径(绝对路径)

3、一个xml配置文件

<?xml version="1.0" ?>

<flex-config xmlns = http://www.adoobe.com/2006/flex-config>

<out-put>MyTheme.swc</out-put>

<include-file>

<name>名字</name>

<path>绝对路径</path>

</include-file>

<include-class>

<class>MyButtonSkin</class>

<class>MyAccordionHeaderSkin</class>

<class>MyControlBarSkin</class>

在执行:compc -load -config xml文件

</include-class>

你可能感兴趣的:(Flex)