How to bottom-align cells in a DataGroup using TileLayout?
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?
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.
精彩评论