<?xml version="1.0" encoding="utf-8"?>
<!--Flex中如何通过getHeaderAt()函数以及selectedUpIcon,selectedOverIcon和selectedDownIcon样式给Accordion头部设置一个分割用图标的例子-->
<s:Application name="Accordion_getHeaderAt_selectedUpIcon_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.controls.Button; [Embed("assets/bullet_red.png")]
private const RedIcon:Class; [Embed("assets/bullet_orange.png")]
private const OrangeIcon:Class; [Embed("assets/bullet_yellow.png")]
private const YellowIcon:Class; [Embed("assets/bullet_green.png")]
private const GreenIcon:Class; [Embed("assets/bullet_blue.png")]
private const BlueIcon:Class; [Embed("assets/bullet_star.png")]
private const StarIcon:Class; protected function accordion_creationCompleteHandler(event:FlexEvent):void
{
var idx:uint;
var len:uint = accordion.numChildren;
var btn:Button;
for (idx=0; idx<len; idx++) {
btn = accordion.getHeaderAt(idx);
btn.useHandCursor = true;
btn.buttonMode = true;
btn.setStyle("selectedUpIcon", StarIcon);
btn.setStyle("selectedOverIcon", StarIcon);
btn.setStyle("selectedDownIcon", StarIcon);
} } ]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<mx:Accordion id="accordion" openDuration="250" width="100%" height="100%" creationComplete="accordion_creationCompleteHandler(event)">
<mx:VBox id="redVbox" label="Red" icon="{RedIcon}" />
<mx:VBox id="orangeVbox" label="Orange" icon="{OrangeIcon}" />
<mx:VBox id="yellowVbox" label="Yellow" icon="{YellowIcon}" />
<mx:VBox id="greenVbox" label="Green" icon="{GreenIcon}" />
<mx:VBox id="blueVbox" label="Blue" icon="{BlueIcon}" />
</mx:Accordion>
</s:Application>

[Flex] Accordion系列 - Header图标的设置的更多相关文章

  1. [Flex] Accodion系列 - Header文本颜色设置

    <?xml version="1.0" encoding="utf-8"?> <!--Flex中如何给Accordion的各个头部文字设置不同 ...

  2. [Flex] Accordion系列 - Header背景图的设置

    <?xml version="1.0" encoding="utf-8"?> <!--Flex中如何通过getHeaderAt()函数以及se ...

  3. [Flex] Accordion系列-Header的运用

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  4. [Flex] Accordion系列-动态添加或删除Accordion容器中项目

    <?xml version="1.0" encoding="utf-8"?> <!--Flex中如何使用addChild()和removeCh ...

  5. [Flex] ButtonBar系列——皮肤和外观设置

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  6. 【ABAP系列】SAP Smartforms 设置纸张打印格式

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP Smartforms 设 ...

  7. php的header()函数之设置content-type

    //定义编码 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type: application/at ...

  8. C#项目打包后安装的桌面快捷方式图标怎么设置成自己想要的图标

    #项目打包后安装的桌面快捷方式图标怎么设置成自己想要的图标 2012-08-25 09:11匿名 | 浏览 3286 次  C#编程 C#项目用vs2005自带的工具打包后安装的桌面快捷方式图标怎么设 ...

  9. php的header函数之设置content-type

    //定义编码 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type: application/at ...

随机推荐

  1. iframe中子页面通过js计算高度(使得页面不会显示不全)

    使用过iframe的人,都知道,它是一个模版,里面有一个iframe,而iframe当中,是可以嵌套多个页面的.(比较常见的问题,就是iframe页面中,经常会出现内容显示不全的时候). 谨记,通过j ...

  2. pouchdb 安装使用

    1. 安装: If you are on a Debian flavor of Linux (Ubuntu, Mint, etc.), you can install CouchDB with: $ ...

  3. curl命令使用大全

    curl命令使用大全 可以看作命令行浏览器 1.开启gzip请求curl -I http://www.sina.com.cn/ -H Accept-Encoding:gzip,defalte 2.监控 ...

  4. NPOI大数据量多个sheet导出源码(原)

    代码如下: #region NPOI大数据量多个sheet导出 /// <summary> /// 大数据量多个sheet导出 /// </summary> /// <t ...

  5. python之chardet库

    chardet库是python的字符编码检测器,能够检测出各种编码的类型,例如: import chardet import urllib.request testdata = urllib.requ ...

  6. SQL SERVER 只有MDF文件的恢复

    方式一: .create a database same name as .mdf file; .Stop SQL Server; . recover .mdf file; . Start SQL S ...

  7. MySQL在一台db服务器上面如何启动多个实例 (转)

    安装过程省略过,源码安装请参考http://write.blog.csdn.net/postlist/1609043/all 整理自己的文档,发现以前做的例子,share下,欢迎大家提出改进意见. 一 ...

  8. LintCode "Post Office Problem" !!!

    * Non-intuitive state design class Solution { public: /** * @param A an integer array * @param k an ...

  9. bzoj1173: [Balkan2007]Point

    Description 给出N个三维空间上的点. 问有多少条直线,这些直线上至少有三个点. Input 第一行给出数字N,N在[4,1000] 下面N行,每行三个数字,用于描述点的坐标,其值在[-10 ...

  10. 【freemaker】之整合springMVC

    pom.xml文件 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncod ...