【问题标题】:Flex: alternatingRowColors alpha colorFlex:alternatingRowColors alpha 颜色
【发布时间】:2012-11-07 16:26:43
【问题描述】:

如何在 flex 4.6 spark DataGrid 中设置alternatingRowColors alpah 颜色

答案:

Tnx 到 www.Flextras.com 我找到了:

在 DataGrid 皮肤中需要像这样覆盖prepareGridVisualElement

public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
{
    const dataGrid:DataGrid = grid.dataGrid;
    if (!dataGrid)
        return;

    const colors:Array = dataGrid.getStyle("alternatingRowColors");
    rowBackgroundFillColor.alpha = rowIndex % 2 == 0 ? 0 : 0.25;
}

【问题讨论】:

    标签: apache-flex datagrid colors alpha


    【解决方案1】:

    使用alternatingRowColors 或样式。

    引用文档:

    用于初始化 DataGrid 的 rowBackground 皮肤部分。如果 指定alternatingRowColors 样式,然后使用 alterRowColorsBackground 皮肤部分的值作为 rowBackground 皮肤部分。网格行的交替颜色是 由该样式的 Array 值中的连续条目定义。

    如果您想更改此样式的呈现方式,请将 DataGridSkin 类中的alternatingRowColorsBackground 皮肤部分。如果 你想为每一行指定背景,然后初始化 rowBackground 皮肤部分直接。默认值未定义。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-12
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多