Alternating tile background colors for items in a tilelist control in flex

Source: Internet
Author: User

The following example shows how you can set alternating background colors for tiles in a flex tilelist control by settingAlternatingitemcolorsStyle using mxml, CSS or ActionScript.

Full code after the jump.

 

<? XML version = "1.0" encoding = "UTF-8" ?>
<! -- Http://blog.flexexamples.com/2008/08/10/alternating-tile-background-colors-for-items-in-a-tilelist-control-in-flex/ -->
< MX: Application Name = "Tilelist_alternatingitemcolors_test"
Xmlns: MX = "Http://www.adobe.com/2006/mxml"
Layout = "Vertical"
Verticalalign = "Middle"
Backgroundcolor = "White" >

< MX: arraycollection ID = "Arrcoll" >
< MX: Source >
< MX: Array >
< MX: Object Label = "One"   />
< MX: Object Label = "Two"   />
< MX: Object Label = "Three"   />
< MX: Object Label = "Four"   />
< MX: Object Label = "Five"   />
< MX: Object Label = "Six"   />
< MX: Object Label = "Seven"   />
< MX: Object Label = "Eight"   />
< MX: Object Label = "Nine"   />
< MX: Object Label = "Ten"   />
< MX: Object Label = "Eleven"   />
< MX: Object Label = "Twelve"   />
</ MX: Array >
</ MX: Source >
</ MX: arraycollection >

< MX: tilelist ID = "Tilelist"
Dataprovider = "{Arrcoll }"
Columncount = "4"
Columnwidth = "120"
Rowcount = "3"
Rowheight = "80"
Alternatingitemcolors = "[# Ffffff, # cccccc, #999999]"   />

</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.