如何使用TileLayout使数据组中的单元格底部对齐? [英] How to bottom-align cells in a DataGroup using TileLayout?

查看:87
本文介绍了如何使用TileLayout使数据组中的单元格底部对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使平铺的DataGroup中的单元格底部对齐,以使行从底部开始而不是从底部开始增长.我想我正在寻找的是类似RowAlign.BOTTOM的东西,但这似乎不存在.

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.

行应该有固定的高度和间距,所以RowAlign.JUSTIFY_USING_GAPRowAlign.JUSTIFY_USING_HEIGHT对我不起作用.

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

有任何提示吗?

推荐答案

是的,我想回答自己的问题.我想做的是扩展TileLayout并覆盖updateDisplayList(),但是由于无法在TileList中过度使用私有,因此我最终复制了整个TileList源,并在updateDisplayList()中更改了几行,例如:

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; 

yPos -= yMajorDelta;

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

一种hack,但可以满足我的需求.

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

这篇关于如何使用TileLayout使数据组中的单元格底部对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆