简体   繁体   English

Spark DataGrid替代行颜色更改

[英]Spark DataGrid alternative Row Color Changes

How to Set alternat Row Color In Flex 4.5 MobileApplication For Spark Data Grid. 如何在Flex 4.5 MobileApplication for Spark数据网格中设置交替行颜色。 The Main Problem Of SparkDataGrid in Mobile Application not Allowed to Add Skin. 不允许在移动应用程序中添加SparkDataGrid的主要问题。

Use the alternatingRowColors style . 使用alterRowColors样式 To quote the docs: 引用文档:

Type: Array Format: Color CSS Inheritance: no Theme: spark 类型:数组格式:颜色CSS继承:无主题:spark

Used to initialize the DataGrid's rowBackground skin part. 用于初始化DataGrid的rowBackground外观部件。 If the alternatingRowColors style is specified, then use the alternatingRowColorsBackground skin part as the value of the rowBackground skin part. 如果指定了alternatingRowColors样式,则将alternatingRowColorsBackground外观部件用作rowBackground外观部件的值。 The alternating colors for the grid rows are defined by successive entries in the Array value of this style. 网格行的交替颜色由此样式的Array值中的连续条目定义。

If you want to change how this style is rendered, replace the alternatingRowColorsBackground skin part in the DataGridSkin class. 如果要更改此样式的呈现方式,请替换DataGridSkin类中的AlternateRowColorsBackground外观部件。 If you want to specify the background for each row, then initialize the rowBackground skin part directly. 如果要为每行指定背景,请直接初始化rowBackground外观部件。

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. 现在,我尚未使用Mobile测试此功能,因此它可能会或可能不会起作用。 Please follow up with results. 请跟进结果。

-Vic -维克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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