Setting styles on individual flex accordion Headers

Source: Internet
Author: User

Well, I played around with it briefly this evening and it seems that you can get individual accordion headings using the accordion class'sGetheaderat ()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;
Textrolovercolor: 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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.