How to bottom-align cells in a DataGroup using TileLayout?

匆匆过客 提交于 2019-12-31 06:49:45

问题


I'd like to bottom-align cells in a tiled DataGroup, so that rows grow bottom-top instead of top-bottom. I guess what i'm looking for is something like RowAlign.BOTTOM, but that doesn't seem to exist.

Rows should have fixed heights and gap, so RowAlign.JUSTIFY_USING_GAP and RowAlign.JUSTIFY_USING_HEIGHT won't work for me.

Any hints?


回答1:


Yes i want to answer my own question. What i wanted to do was extend TileLayout and override updateDisplayList(), but due to excessive use of privates in TileList that was not possible so i ended up copying the whole TileList source and changed a few lines in updateDisplayList(), eg:

var yPos:Number = unscaledHeight - visibleStartY - _rowHeight; 

and

yPos -= yMajorDelta;

and

// Move along the minor axis
if (++counter >= counterLimit)
{
    counter = 0;
    if (orientation == TileOrientation.ROWS)
    {
        xPos = 0;
        yPos -= yMinorDelta;
    }
    else
    {
        xPos += xMinorDelta;
        yPos = unscaledHeight - visibleStartY - _rowHeight;
    }
}

a hack, sort of, but works fine for my needs.



来源:https://stackoverflow.com/questions/3089884/how-to-bottom-align-cells-in-a-datagroup-using-tilelayout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!