博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Setting styles on individual Flex Accordion headers
阅读量:5749 次
发布时间:2019-06-18

本文共 1544 字,大约阅读时间需要 5 分钟。

Well, I played around with it briefly this evening and it seems that you can get individual accordion headings using the Accordion class’s getHeaderAt() method, then it is just a matter of saving that reference in a variable, or applying a style directly to the returned Button reference.

The example itself is pretty simple, but I’m sure the same principles apply to other styles as well

<?
xml version="1.0" encoding="utf-8"
?>
<!--
 http://blog.flexexamples.com/2007/10/30/setting-styles-on-individual-flex-accordion-headers/ 
-->
<
mx:Application 
xmlns:mx
="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white"
>
    
<
mx:Style
>
        AccordionHeader {
            fillColors: black, black;
            fillAlphas: 1, 1;
            textRollOverColor: white;
            textSelectedColor: white;
            themeColor: black;
        }
    
</
mx:Style
>
    
<
mx:Script
>
        
<![CDATA[
            private function init():void {
                accordion.getHeaderAt(0).setStyle("color", "red");
                accordion.getHeaderAt(1).setStyle("color", "haloOrange");
                accordion.getHeaderAt(2).setStyle("color", "yellow");
                accordion.getHeaderAt(3).setStyle("color", "haloGreen");
                accordion.getHeaderAt(4).setStyle("color", "haloBlue");
            }
        
]]>
    
</
mx:Script
>
    
<
mx:Accordion 
id
="accordion"
            width
="300"
            height
="200"
            creationComplete
="init();"
>
        
<
mx:VBox 
label
="Red"
 
/>
        
<
mx:VBox 
label
="Orange"
 
/>
        
<
mx:VBox 
label
="Yellow"
 
/>
        
<
mx:VBox 
label
="Green"
 
/>
        
<
mx:VBox 
label
="Blue"
 
/>
    
</
mx:Accordion
>
</
mx:Application
>
    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/13/1037071.html
,如需转载请自行联系原作者
你可能感兴趣的文章
Python学习笔记
查看>>
LeetCode2_Evaluate Reverse Polish Notation评估逆波兰表达式(栈)
查看>>
文献综述二:UML技术在行业资源平台系统建模中的应用
查看>>
阿里云服务器 linux下载 jdk
查看>>
Swift 学习 用 swift 调用 oc
查看>>
Loadrunner应用系统测试
查看>>
第三章 Python 的容器: 列表、元组、字典与集合
查看>>
struct timeval
查看>>
stringstream中的clear()与str()
查看>>
微信小程序开发 -- 点击右上角实现转发功能
查看>>
前端布局学习
查看>>
问题解决-Failed to resolve: com.android.support.constraint:constraint-layout:1.0.0-alpha7
查看>>
openURL的使用
查看>>
与MS Project相关的两个项目
查看>>
[转载]ASP.NET MVC Music Store教程(1):概述和新项目
查看>>
css实现单行,多行文本溢出显示省略号……
查看>>
使用 SharpSvn 执行 svn 操作的Demo
查看>>
js函数大全
查看>>
hdu 4831 Scenic Popularity(模拟)
查看>>
刷题笔记
查看>>