2012-11-07 2 views
1

플렉스 : 플렉스 4.6 스파크 데이터 그리드의 색상 alpah은 alternatingRowColors을 설정하는 방법은 alternatingRowColors 알파 색상

답변 : 데이터 그리드 피부에

: 나는 그것을 발견 www.Flextras.com에

TNX

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; 
} 

답변

2

사용 alternatingRowColors 또는 우리 군이 같은 prepareGridVisualElement를 재정의해야 르.

는 문서를 인용하려면 : 데이터 그리드의 rowBackground 피부 부분을 초기화하는 데 사용

. alternatingRowColors 스타일이 지정된 경우 alternatingRowColorsBackground 스킨 부분을 rowBackground 스킨 부분의 값으로 사용합니다. 격자 행의 색상은이 스타일의 Array 값에 연속적인 항목으로 정의 된 입니다.

이 스타일의 렌더링 방식을 변경하려면 DataGridSkin 클래스의 alternatingRowColorsBackground 스킨 부분을 바꾸십시오. 각 행의 배경을 지정하려면 rowBackground 스킨 부분을 직접 초기화하십시오. 기본값은 정의되지 않습니다.

관련 문제