简体   繁体   中英

Spark DataGrid alternative Row Color Changes

How to Set alternat Row Color In Flex 4.5 MobileApplication For Spark Data Grid. The Main Problem Of SparkDataGrid in Mobile Application not Allowed to Add Skin.

Use the alternatingRowColors style . To quote the docs:

Type: Array Format: Color CSS Inheritance: no Theme: spark

Used to initialize the DataGrid's rowBackground skin part. If the alternatingRowColors style is specified, then use the alternatingRowColorsBackground skin part as the value of the rowBackground skin part. The alternating colors for the grid rows are defined by successive entries in the Array value of this style.

If you want to change how this style is rendered, replace the alternatingRowColorsBackground skin part in the DataGridSkin class. If you want to specify the background for each row, then initialize the rowBackground skin part directly.

The default value is undefined.

Add the following style to your application:

s|DataGrid
{
    alternatingRowColors:#FFFFFF,#CCCCCC;
}

This will make the odd rows white and the even rows gray. Now, I have not tested this using Mobile so it may or may not work. Please follow up with results.

-Vic

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM